Structured access to all attributes of the netCDF file.

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)
#> [1] "Giving the properties for the file. For more info on a specific datacube, define the metric and scenario OR datacubepath."
#get properties for the file and a specific datacube - use datacubepath
prop_dc <- ebv_properties(file, datacubepath = datacubes[1,1])
#> [1] "Giving the properties for the file and a specified datacube."
#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)
#> [1] "Referring to datacubepath metric_2/ebv_cube"
#> [1] "Giving the properties for the file and a specified datacube."