write.GLCexternal {Rglimclim} | R Documentation |
To convert a data frame of external covariate data into a file suitable for input into the Rglimclim
model fitting or simulation routines.
write.GLCexternal(x, var.names, file, check.file = TRUE)
x |
A data frame containing predictor information at a daily, monthly or
yearly time scale. If the time scale is daily then |
var.names |
An optional vector of names for the non-date variables in |
file |
Name of the output file. |
check.file |
If |
If the software is to be used for downscaling then files of external predictor (covariate) data are required (see the documentation for GLCfit
, in particular the external.files
argument to that function). The format of these files is tightly specified; the present routine provides an easy way to generate them.
External predictor data for the fitting and simulation routines are stored in different files depending on whether they vary on a daily, monthly or annual timescale. The appropriate timescale for the data in x
is inferred from the variable names (so if x
contains a column called Year
and column called Month
but no variable called Day
, the inference is that the data are monthly).
The routine returns a NULL
value; its sole effect is to write the required data to file
.
This routine has not been tested extensively. Note also that it is the user's responsibility to check that the dates in x
are contiguous and in the right order - the routine does not check this (the model fitting and simulation routines will pick up any problems later, however).
Richard Chandler (richard@stats.ucl.ac.uk)