ebv_properties {ebvcube}R Documentation

Read properties of EBV netCDF

Description

Structured access to all attributes of the netCDF file.

Usage

ebv_properties(
  filepath,
  datacubepath = NULL,
  scenario = NULL,
  metric = NULL,
  verbose = TRUE
)

Arguments

filepath

Character. Path to the netCDF file.

datacubepath

Character. Optional. Default: NULL. Path to the datacube (use ebv_datacubepaths()). Alternatively, you can use the scenario and metric argument to define which cube you want to access.

scenario

Character or integer. Optional. Default: NULL. Define the scenario you want to access. If the EBV netCDF has no scenarios, leave the default value (NULL). You can use an integer value defining the scenario or give the name of the scenario as a character string. To check the available scenarios and their name or number (integer), use ebv_datacubepaths().

metric

Character or integer. Optional. Define the metric you want to access. You can use an integer value defining the metric or give the name of the scenario as a character string. To check the available metrics and their name or number (integer), use ebv_datacubepaths().

verbose

Logical. Default: TRUE. Turn off additional prints by setting it to FALSE.

Value

S4 class containing information about file or file and datacube depending on input.

Examples

#define path to EBV netCDF
file <- system.file(file.path("extdata","martins_comcom_subset.nc"), package="ebvcube")
#get all datacubepaths of EBV netCDF
datacubes <- ebv_datacubepaths(file, verbose=FALSE)

#get properties only for the file
prop_file <- ebv_properties(file)
#get properties for the file and a specific datacube - use datacubepath
prop_dc <- ebv_properties(file, datacubepath = datacubes[1,1])
#get properties for the file and a specific datacube - use scenario & metric
#note: this dataset has no scenario -> only metric is defined
prop_dc <- ebv_properties(file, metric = 2)

[Package ebvcube version 0.2.3 Index]