Learn R Programming

SticsRFiles (version 1.7.0)

gen_varmod: Generating a var.mod type file

Description

Generating a daily variable list file from variables names

Usage

gen_varmod(
  workspace,
  var,
  append = FALSE,
  file_name = "var.mod",
  stics_version = "latest",
  force = FALSE,
  verbose = FALSE
)

Value

None

Arguments

workspace

Path of the directory containing the STICS var.mod file to modify

var

vector of variables names (see details)

append

if TRUE, var data are appended to file_name

file_name

file name to generate (without path, default value: "var.mod")

stics_version

Name of the STICS version (used to check variable names)

force

Force variables writing even if they are not a STICS variable (default: FALSE).

verbose

if TRUE displaying warning, FALSE otherwise (default)

Details

Variable names can be found using get_var_info(). They are checked before writing. If any variable name does not exist, it will not be written by default, but the function will still write the variables that exist. force= TRUE may however be used to write variables that do not exist. Variables already present in a var.mod file can be listed using get_varmod().

Examples

Run this code
# generate a new file
gen_varmod(tempdir(), c("lai(n)", "hauteur"))
# Add a variable to the others
# var.mod will contain now "lai(n)","hauteur" and "masec(n)"
gen_varmod(tempdir(), "masec(n)", append = TRUE)

Run the code above in your browser using DataLab