read.slv: Import .SLV files to R

View source: R/read.slv.R

read.slvR Documentation

Import .SLV files to R

Description

A set of functions to import model files of DBSolveOptimum (.SLV) to R-environment as the object of class ruSlv.
read.slv function reads .SLV file and creates list of format ruSlv.raw
compatible.slv function checks compatibility of ruSlv.raw passed from read.slv for compatibility with current version of import.slv.
import.slv function analyzes ruSlv.raw passed from read.slv and creates the object of class ruSlv.

Usage

read.slv(file)

compatible.slv(x)

import.slv(x)

Arguments

file

valid .SLV file saved from DBSolveOptimum.

x

object of format ruSlv.raw to use for model import.

Details

In many cases DBSolveOptimum features are not enough to manipulate the model structure and to simulate specific conditions. This set of functions transforms all the structure of .SLV file to the R-environment for easy manipulation.

read.slv function reads model code from file and perform initial parsing based on SLV version described in file ‘slv25tab.csv’.

import.slv analyzes different parts of read.slv output and create an object of class ruSlv which is an image of initial .SLV file. compatible.slv is developed to check the structure of ruSlv.raw object for further parsing using import.slv. It is part of import.slv function so it is not necessary to use it separately.

Value

read.slv

returns list of the format ruSlv.raw

compatible.slv

returns TRUE if x output is compatible with current version of import.slv and FALSE otherwise

import.slv

returns the object of mode list and ruSlv class attribute

Note

The current version of dbs-package officially supports only .SLV version 25. Try compatible.slv to check.
Known restrictions:

  1. Cannot read 'events'

  2. Cannot read 'fit conditions'

See Also

rct.from.slv
C.from.slv

Examples

### import 'example4.slv'
filePath<-system.file(package = "dbs", "extdata/example4.slv")
raw<-read.slv(filePath) # read from example
compatible.slv(raw) # TRUE
example4_ruSlv<-import.slv(raw)

### import 'example1.slv'
filePath<-system.file(package = "dbs", "extdata/example1.slv")
raw<-read.slv(filePath) # read from example
compatible.slv(raw) # TRUE
example1_ruSlv<-import.slv(raw)

insysbio/dbs-package documentation built on Aug. 4, 2022, 2:11 p.m.