create_variable_definitions: Create variable definitions from a data frame

View source: R/variables.R

create_variable_definitionsR Documentation

Create variable definitions from a data frame

Description

Given a data frame as input, create a list of variable definitions usable by the function create_efts_variables to create netCDF variables.

Usage

create_variable_definitions(dframe)

Arguments

dframe

a data frame, one line is one variable definition. Must have at least the following column names: 'name', 'longname', 'units', 'missval', 'precision', 'type', 'type_description', 'location_type'

Value

a list of length equal to the number of rows in the input data frame

See Also

See create_efts for examples

Examples

varsDef = data.frame(name=letters[1:3], stringsAsFactors=FALSE)
varsDef$longname=paste('long name for', varsDef$name)
varsDef$units='mm'
varsDef$missval=-999.0
varsDef$precision='double'
varsDef$type=2
varsDef$type_description='accumulated over the previous time step'
varsDef$location_type='Point'
str(create_variable_definitions(varsDef))


jmp75/efts documentation built on Feb. 3, 2023, 2:44 p.m.