The documentation doesn't say how to use add.elem for read.msc. It is used to identify and read other attributes from the MSC archive file format.
The add.elem list or data.frame structure must have 5 fields:
alias : a number code used in the file
name : a short name, no spaces or non-ASCII characters
long.name : a longer name for axis labels
units : units for axis labels
scale : a multiplier to transform the archive data to meaningful numbers that match the units
The built-in elements (internally as elem.all) are:
alias name long.name units scale
1 1 t_max daily maximum temperature °C 0.100
2 2 t_min daily minimum temperature °C 0.100
3 3 t_mean daily mean temperature °C 0.100
4 10 rain total rainfall mm 0.100
5 11 snow total snowfall mm 0.100
6 12 precip total precipitation mm 0.100
7 13 snow_d snow on the groud cm 1.000
8 77 press station pressure kPa 0.010
9 123 rain hourly rainfall mm 0.100
10 133 sun sunshine hrs 0.100
11 61 solar RF1 global solar radiation MJ/m² 0.001
12 64 net_solar RF4 net-all wave radiation MJ/m² 0.001
So to add one custom element:
dat <- read.msc(fname, add.elem=list(alias=123, name="my_var", long.name="My variable",
units="mm", scale=0.1))
and multiple elements can be added by constructing a data.frame that can be combined with the internal elem.all structure with rbind. The internal elem.all can be expanded on request.
The task is to complete the built-in documentation for R.
The documentation doesn't say how to use
add.elemforread.msc. It is used to identify and read other attributes from the MSC archive file format.The
add.elemlist or data.frame structure must have 5 fields:alias: a number code used in the filename: a short name, no spaces or non-ASCII characterslong.name: a longer name for axis labelsunits: units for axis labelsscale: a multiplier to transform the archive data to meaningful numbers that match the unitsThe built-in elements (internally as
elem.all) are:So to add one custom element:
and multiple elements can be added by constructing a data.frame that can be combined with the internal
elem.allstructure withrbind. The internalelem.allcan be expanded on request.The task is to complete the built-in documentation for R.