Last data update: 2014.03.03

R: Read initial conditions from a LSD results file
info.init.lsdR Documentation

Read initial conditions from a LSD results file

Description

This function reads the initial condition values from a LSD results file (.res).

Usage

info.init.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).

Value

Returns a 1 line matrix containing the initial conditions (row 1) of all variables contained in the selected results file.

Note

The returned matrix contains all variables in the results file, even the ones that don't have an initial condition (indicated as NA). Only variables automatically initialized automatically by LSD in t = 1 are included here.

Author(s)

Marcelo C. Pereira

See Also

info.details.lsd, info.names.lsd info.dimensions.lsd

Examples

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

init1 <- info.init.lsd("Sim1_1.res")
#View(init1)

init2 <- info.init.lsd("Sim1_2.res.gz")
#View(init2)

# 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.init.lsd.Rd_%03d_medium.png", width=480, height=480)
> ### Name: info.init.lsd
> ### Title: Read initial conditions from a LSD results file
> ### Aliases: info.init.lsd
> ### Keywords: ~kwd1 ~kwd2
> 
> ### ** Examples
> 
> # Save current work directory and change to the examples directory
> currWD <- getwd()
> setwd(system.file("extdata", package = "LSDinterface"))
> 
> init1 <- info.init.lsd("Sim1_1.res")
> #View(init1)
> 
> init2 <- info.init.lsd("Sim1_2.res.gz")
> #View(init2)
> 
> # Restore working directory
> setwd(currWD)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>