getAttributes: getAttributes

Description Usage Arguments Details Value Author(s) Examples

Description

List the netCDF attributes for a specified variable or data.frame

Usage

1
getAttributes(dname, vname = NULL, .print = TRUE)

Arguments

dname

The name of the data.frame. Alternately, a data.frame column.

vname

The name of a variable in the netCDF file. If provided, this can be either a column name in 'dname' (e.g., "TASX") or the variable itself (e.g., TASX). If omitted, the attributes of the first parameter (the data.frame) will be returned.

.print

A logical variable indicating if the values should be printed. Default is TRUE. The format of this listing is more concise than that obtained by printing the returned list of attributes, so when used interactively it may be preferable to use .print=TRUE and assign the returned list to avoid printing it a second time; e.g., Z <- getAttributes(RAFdata, TASX)

Details

Prints the netCDF attributes and their values, and returns a text vector with the names of the attributes, for a specified data.frame. For variable attributes, the name of the variable should be specified as a string. For global attributes, omit the 'vname' parameter. This function is designed to work with data.frames generated by Ranadu::getNetCDF.R, and for such data.frames it will list attributes as in the original netCDF file from which the data.frame was generated.

Value

A list of the attributes and associated values

Author(s)

William Cooper

Examples

1
2
3
ATT <- getAttributes (RAFdata, TASX)
ATT <- getAttributes (RAFdata)
ATT <- getAttributes (RAFdata, "TASX", .print=FALSE)

WilliamCooper/Ranadu documentation built on July 10, 2019, 12:40 a.m.