Description Usage Arguments Details Examples
Reads APSIM .out files.
1 2 3 |
dir |
(optional) The directory to search for .out files. This is not recursive. If omitted, the current working directory will be used. |
loadAll |
If TRUE will load all files in |
filter |
A regular expression that matches the files to be loaded.
Default is |
returnFrame |
Return the data as a data frame or data table. Default is TRUE, FALSE returns a data table. |
n |
Read the first n files. Good for testing/debugging. Default is 0 (read all files found). |
fill |
Where the number or names of columns is not consistent across files, fill missing columns with NA. Default is FALSE which will throw an error if the columns don't match across all files. |
addConstants |
Add any constants (such as ApsimVersion, Title or factor levels) found as extra columns. Default is TRUE. |
skipEmpty |
Silently skip empty output files. If false, empty files will cause an error. Default is FALSE. |
By default, this function will read in all output files in a directory and
combine them into a single data table. Setting loadAll=FALSE
will read
a single file. If the path is omitted it will try to find the file in the current
working directory. Constants in outputs will be added as data columns and output
files with differing numbers of columns can also be imported although by
default this will result in an error. Care should be taken when using this
option as a different number of columns in output files usually means the
data came from a different set of reports or simulations which may not be
relevant to your analysis.
1 2 3 4 5 6 7 | ## Not run: loadApsim("c:/outputs") # load everything in the outputs directory
## Not run: loadApsim("c:/outputs/simulation.out", loadAll=FALSE)
# load a single file (note extension is required).
## End(Not run)
## Not run: loadApsim("c:/outputs", returnFrame=FALSE, fill=TRUE)
# load everything in the outputs directory, fill any missing columns and return a data table.
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.