Last data update: 2014.03.03

R: Dimension information for a LSD results file
info.dimensions.lsdR Documentation

Dimension information for a LSD results file

Description

This function reads some dimension information from a LSD results file (.res): number of time steps, number of variables and the original column (variable) names.

Usage

info.dimensions.lsd(file)

Arguments

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(). Tilde-expansion is performed where supported. This can be a compressed file (see file) and must include the appropriated extension (usually .res or .res.gz).

Details

The returned number of time steps does not include the initial value (t = 0) for lagged variables (the second line of a .res format file).

Value

Returns a list containing two integer values and a character vector describing the selected results file.

tSteps

Number of time steps in file

nVars

Number of variables (including duplicated instances) in file

varNames

Names of variables (including duplicated instances) in file, after R name conversion

Author(s)

Marcelo C. Pereira

See Also

info.details.lsd, info.names.lsd, info.init.lsd

Examples

# Save current work directory and change to the examples directory
currWD <- getwd()
setwd(system.file("extdata", package = "LSDinterface"))

info.dimensions.lsd("Sim1_1.res")
info.dimensions.lsd("Sim1_2.res.gz")

# Restore working directory
setwd(currWD)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(LSDinterface)
Loading required package: abind
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/LSDinterface/info.dimensions.lsd.Rd_%03d_medium.png", width=480, height=480)
> ### Name: info.dimensions.lsd
> ### Title: Dimension information for a LSD results file
> ### Aliases: info.dimensions.lsd
> ### Keywords: ~kwd1 ~kwd2
> 
> ### ** Examples
> 
> # Save current work directory and change to the examples directory
> currWD <- getwd()
> setwd(system.file("extdata", package = "LSDinterface"))
> 
> info.dimensions.lsd("Sim1_1.res")
$tSteps
[1] 100

$nVars
[1] 17

$varNames
 [1] "GDP.1.1_100"         "Creal.1.1_100"       "Ir.1.1_100"         
 [4] "Am.1.1_100"          "G.1.1_100"           "Def.1.1_100"        
 [7] "Deb.1.1_100"         "X_A1p.1_1.1_100"     "X_growth1.1_1.1_100"
[10] "X_A1p.1_2.1_100"     "X_growth1.1_2.1_100" "X_A1p.1_3.1_100"    
[13] "X_growth1.1_3.1_100" "X_A1p.1_4.1_100"     "X_growth1.1_4.1_100"
[16] "X_A1p.1_5.1_100"     "X_growth1.1_5.1_100"

> info.dimensions.lsd("Sim1_2.res.gz")
$tSteps
[1] 100

$nVars
[1] 17

$varNames
 [1] "GDP.1.1_100"         "Creal.1.1_100"       "Ir.1.1_100"         
 [4] "Am.1.1_100"          "G.1.1_100"           "Def.1.1_100"        
 [7] "Deb.1.1_100"         "X_A1p.1_1.1_100"     "X_growth1.1_1.1_100"
[10] "X_A1p.1_2.1_100"     "X_growth1.1_2.1_100" "X_A1p.1_3.1_100"    
[13] "X_growth1.1_3.1_100" "X_A1p.1_4.1_100"     "X_growth1.1_4.1_100"
[16] "X_A1p.1_5.1_100"     "X_growth1.1_5.1_100"

> 
> # Restore working directory
> setwd(currWD)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>