# get the list of file names of example LSD results
files <- list.files.lsd( system.file( "extdata", package = "LSDinterface" ) )
# load first .res file into a simple matrix (first instances only)
macroVar <- read.single.lsd( files[ 1 ] )
print( macroVar[ 10 : 20, 5 : 9 ] )
# read second instance of a set of variables named '_A1p' and '_growth1'
ag2Table <- read.single.lsd( files[ 2 ], col.names = c( "_A1p", "_growth1" ),
instance = 2 )
print( ag2Table[ 10 : 15, ] )
# read first instance of all variables, skipping the initial 20 time steps
# and keeping up to 30 time steps (from t = 21 up to t = 30)
var21_30 <- read.single.lsd( files[ 3 ], skip = 20, nrows = 30 )
print( var21_30[ , 1 : 7 ] )
# read third instance of all variables at the second object level
var2_3_5 <- read.single.lsd( files[ 1 ], instance = 3, posit = "*_*",
posit.match = "glob" )
print( var2_3_5[ 20 : 25, ] )
Run the code above in your browser using DataLab