Description Usage Arguments Value Note Author(s) See Also Examples
This function reads all the data series in a LSD results file (.res).
1 | read.raw.lsd(file, nrows = -1, skip = 0)
|
file |
the name of the LSD results file which the data are to be read from. If it does not contain an absolute path, the file name is relative to the current working directory, getwd(). This can be a compressed file (see file) and must include the appropriated extension (usually .res or .res.gz). |
nrows |
integer: the maximum number of time steps (rows) to read in. Negative and other invalid values are ignored. The default is to read all rows. |
skip |
integer: the number of time steps (rows) of the results file to skip before beginning to read data. The default is to read from the first time step (t = 1). |
Returns a single matrix containing all variables' time series contained in the results file.
The returned matrix may be potentially very wide.
For extracting data in a more selective way, see read.single.lsd
and read.multi.lsd
. To use multiple results files simultaneously, see read.list.lsd
and read.3d.lsd
.
Variable names are never "cleaned", even for single instanced variables.
Marcelo C. Pereira
read.single.lsd
,
read.multi.lsd
,
read.list.lsd
,
read.3d.lsd
,
read.4d.lsd
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Get the examples directory
path <- system.file( "extdata", package = "LSDinterface" )
# reads all instances of all variables,
# pasting the directory where the example files are (not required if in working dir)
bigTable <- read.raw.lsd( paste0( path, "/", "Sim1_1.res" ) )
# See matrix in the data viewer (require package 'utils')
View( bigTable )
# reads all instances of all variables, skipping the initial 20 time steps
# and keeping up to 50 time steps (from t = 21 up to t = 70)
all21_70 <- read.raw.lsd( paste0( path, "/", "Sim1_2.res.gz" ),
skip = 20, nrows = 50 )
View( all21_70 )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.