nc_attributes_from_template: Write attributes from template

View source: R/nc_attributes_from_template.R

nc_attributes_from_templateR Documentation

Write attributes from template

Description

Write any number of netCDF attributes from a csv template specifying variable names and attribute properties.

Usage

nc_attributes_from_template(nc_object, templatefile, verbose = F)

Arguments

nc_object

An object of class ncdf4, indicating what file to write to.

templatefile

character, path to a csv text file that provides information about the attributes to add. See details

verbose

logical, whether to print additional output

Details

This function allows the same variable attributes to be standardized across a number of netcdf objects without having to change each one manually.

The templatefile csv should have the following column headers: variable_id: the name of the variable to which to add an attirubte. Leave blank to create global attributes attribute_name: the name of the desired attribute attribute_value: the value of the attribute precision: the precision of the attribute. Can have values of "short", "float", "double", or "text". If unspecified, the written precision is the same as the variable whose attribute it is.

Author(s)

Nick Brown <nick.brown@carleton.ca>


geocryology/PermafrostDB documentation built on April 17, 2025, 11:54 a.m.