Learn R Programming

rodeo (version 0.8.2)

compile: Generate Executable Code

Description

Creates and 'compiles' a function for use with numerical methods from package deSolve or rootSolve.

Value

invisible(NULL)

Arguments

sources

Name(s) of source files(s) where functions appearing in process rates or stoichiometric factors are implemented. Can be NULL if no external functions are required, the name of a single file, or a vector of file names. See notes below.

fortran

If TRUE, Fortran code is generated and compiled into a shared library. If FALSE, R code is generated.

target

Name of a 'target environment'. Currently, 'deSolve' is the only supported value.

lib

File path to be used for the generated library (without the platform specific extension). Note that any uppercase characters will be converted to lowercase. By default, the file is created in R's temporary folder under a random name.

reuse

If TRUE, an already existing library file will be loaded. Use this to prevent unnecessary re-compilation but note that R is likely to crash in case of any mismatches between the object and the existing library. Default is FALSE, i.e. the library is unconditionally build from scratch.

See Also

This method internally calls generate.

Examples

Run this code
data(vars, pars, funs, pros, stoi)
model <- rodeo$new(vars, pars, funs, pros, stoi, dim=c(1))
# This would trigger compilation assuming that 'functionsCode.f95' contains
# a Fortran implementation of all functions; see vignette for full example
if (FALSE) {
model$compile(sources="functionsCode.f95")
}

Run the code above in your browser using DataLab