View source: R/functions_netCDF.R
read_attributes_from_netCDF | R Documentation |
Read all attributes of a group from a netCDF
read_attributes_from_netCDF(
x,
group = c("var", "xy", "crs", time_name, vertical_name, "global", "all"),
var = NULL,
xy_names = c("lon", "lat"),
time_name = "time",
vertical_name = "vertical",
nc_name_crs = "crs"
)
x |
An object identifying a netCDF file, i.e.,
a character string as file name or an object of class ncdf4 derived
from |
group |
A character string. Specifies which attributes to extract. |
var |
A character string. The name or names of the variables from
which to extract attributes, used if the "var" |
xy_names |
A vector with two character strings. The names of the x and y spatial dimensions of a netCDF file. |
time_name |
A character string. The dimension name corresponding to the time axis. |
vertical_name |
A character string. The dimension name corresponding to the vertical axis. |
nc_name_crs |
A character string. The name of the crs variable
in the netCDF.
Function |
A named list
Example code is available in the documentation of
read_netCDF
.
If attributes of a variable are requested (group is "var"),
then the variable name must be passed to var
.
If xy-space attributes are requested (group is "xy"),
then the names of the x and y dimension must be passed to
xy_names
.
If crs attributes are requested (group is "crs"),
then the name must be passed to nc_name_crs
.
To obtain all attributes from each group, pass "all" to group
;
var
, xy_names
, nc_name_crs
must be correctly specified.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.