assignNames {envirem}R Documentation

Defining variable names

Description

The naming scheme for the different input variables are defined via a custom environment, which only needs to be done once.

Usage

assignNames(tmin, tmax, tmean, precip, solrad, pet, reset)

Arguments

tmin

naming scheme for minimum temperature

tmax

naming scheme for maximum temperature

tmean

naming scheme for mean temperature

precip

naming scheme for precipitation

solrad

naming scheme for solar radiation

pet

naming scheme for monthly potential evapotranspiration

reset

if TRUE, then names are set to default values

Details

The .var environment contains the naming scheme for the input variables, and this will be queried by the various functions in this R package. The user should use this function to define the names of the variables, up until the variable number, and after the variable number (prefix and suffix relative to the number). This is done by providing a template of the naming, and placing ## where the numbers would be (1:12). For example, if your minimum temperature rasters are named as worldclim_v2_LGM_ccsm4_minTemp_1_land.tif, then you should define the following: "worldclim_v2_LGM_ccsm4_minTemp_##_land" for tmin. File extensions should not be included at all (not as a suffix).

This only needs to be done once during your R session. For any variable name, if these tags are removed, and the file extension is removed, only the variable number should remain (the month number).

When using the assignNames() function, you can specify as many or as few as needed.

Variable numbers can have zero-padding. This is handled automatically. Therefore, bio_1 or bio_01 are both fine, and nothing needs to be specified.

The default values are tmin_, tmax_, tmean_, precip_, et_solrad_ and pet_, with no suffix. You can use the function namingScheme() to see the current assigned values.

Examples


namingScheme()
assignNames(precip = 'precip_##_5arcmin')	
assignNames(solrad = 'solar_##', tmin = 'minTemp##')
namingScheme()

# set back to default
assignNames(reset = TRUE)


[Package envirem version 3.0 Index]