campsismod1.3.0 package

Generic Implementation of a PK/PD Model

auto_replication_settings-class

Auto replication settings class.

autoDetectNONMEM

Auto-detect special variables from NONMEM as compartment properties. B...

delete

Delete an element from this list.

disable

Disable.

double_array_parameter-class

Double-array parameter class. This parameter has 2 indexes. It can thu...

duration_record-class

(Infusion)-duration record class.

equation-class

Equation class. Any statement in the form A = B.

Equation

Create a new equation.

error_record-class

Error record class.

ErrorRecord

Create ERROR code record.

export_type-class

Export type class.

export

Export function.

exportToJSON

Export the given object to a JSON object, ready to be written to files...

extractLhs

Extract left-hand-side expression.

extractRhs

Extract right-hand-side expression.

extractTextBetweenBrackets

Extract text between brackets.

f_record-class

Bioavailability record class.

find

Find an element in list.

fixOmega

Fix omega matrix for SAME OMEGA parameters that have NA values due to ...

flagSampledParameterRows

Flag all parameter rows that have at least one parameter out of the sp...

getByIndex

Get element by index.

getByName

Get an element from a list by name. Never return more than 1 element.

getCampsismodOption

Get Campsismod option logic.

getCampsismodOptions

Get the Campsismod options (R options).

getCompartmentIndex

Get the compartment index for the specified compartment name.

getCompartments

Detect all compartments names from the code records. Only for model in...

getMappingMatrix

Return a matrix filled in with OMEGA/SIGMA names to be mapped with the...

getName

Get element name.

getNameInModel

Get the name of the given parameter in the Campsis model.

getNames

Get element names from list.

getNONMEMName

Get NONMEM name.

getOmegaBlock

Get the right block of OMEGA's.

getOmegaIndexes

Get the indexes of the omegas.

getPrefix

Get prefix.

getRecordDelimiter

Get record delimiter.

getRecordEquationNames

Get record equation names

getRecordName

Get record name.

getUncertainty

Get uncertainty on the parameters.

getVarCov

Get variance-covariance matrix.

grapes-greater-than-grapes

Magritt operator for piping.

hasComment

Check if string contains Campsis-style comments.

hasOffDiagonalOmegas

Has off-diagonal omegas.

if_statement-class

If-statement class. Any statement in the form if (condition) A = B.

IfStatement

Create a new IF-statement.

ifStatementPatternStr

Return the IF-statement pattern (string form).

indexOf

Get the index of an element in list.

InfusionDuration

Create an infusion duration.

InfusionRate

Create an infusion rate.

init_record-class

Init record class.

InitialCondition

Create an initial condition.

isBlockFixed

Say if the block is fixed (i.e. all parameters are fixed).

isComment

Check if string is a Campsis comment (i.e. not an equation).

isDiag

Is diagonal.

isEmptyLine

Check if string is an empty line.

isEquation

Say if line in record is an equation not.

isIfStatement

Say if line in record is an IF-statement.

isMatrixPositiveDefinite

Is matrix positive definite. Same check as mvtnorm does.

isODE

Say if line(s) in record is/are ODE or not.

isRecordDelimiter

Is record delimiter. A record delimiter is any line starting with [......

isRxODE

Check if the destination engine is RxODE or rxode2. Note that rxode2 i...

isStrictRecordDelimiter

Is strict record delimiter. A strict record delimiter is any line star...

json_element-class

JSON element class.

JSONElement

Instantiate a JSON element.

jsonToCampsisModel

JSON to Campsis dataset.

jsonToOffDiagParameter

Convert JSON correlation parameter (OMEGA or SIGMA) into a Campsis par...

jsonToParameter

JSON to Campsis parameter.

lag_record-class

Lag record class.

LagTime

Create a lag time for the specified compartment.

length

Return the length of this list.

line_break-class

Line-break class. A linebreak in the model.

LineBreak

Create a new line break.

loadFromJSON

Fill-in S4 object from the JSON content.

main_record-class

Main record class.

MainRecord

Create MAIN code record.

manual_replication_settings-class

Manual replication settings class.

ManualReplicationSettings

Create manual replication settings.

mapJSONPropertiesToS4Slots

Map JSON properties to S4 slots.

mapS4SlotsToJSONProperties

Map S4 slots to JSON properties.

matchDoubleArrayParameter

Match double array parameter from list based on the name instead of th...

matchSingleArrayParameter

Match single array parameter from list based on the name instead of th...

maxIndex

Max index.

methodsGlobalFunctions

A empty method only used to declare some of the global function defini...

minIndex

Min index.

minMaxDefault

Min/max default values for the given parameter.

model_statement-class

Model statement class. Any statement in a code record.

model_statements-class

Model statements class. A list of statements.

ModelStatements

Create an empty list of model statements.

move

Move element 'x' from object to a certain place.

mrgsolve_type-class

Mrgsolve export type class.

mrgsolveBlock

Convert code record for mrgsolve.

mrgsolveCapture

Get the CAPTURE block for mrgsolve.

mrgsolveCompartment

Get the compartment block for mrgsolve.

mrgsolveMain

Get the MAIN block for mrgsolve.

mrgsolveMatrix

Get the OMEGA/SIGMA matrix for mrgsolve.

mrgsolveOde

Get the ODE block for mrgsolve.

mrgsolveParam

Get the parameters block for mrgsolve.

mrgsolveTable

Get the TABLE block for mrgsolve.

ode_record-class

ODE record class.

ode-class

ODE class. Any statement in the form d/dt(A_CMT) = B.

Ode

Create a new ordinary differential equation (ODE).

OdeRecord

Create ODE code record.

omega-class

Omega parameter class.

Omega

Create an OMEGA parameter.

OmegaBlock

Create a block of OMEGA's.

OmegaBlocks

Create a list of OMEGA blocks.

openJSON

Open JSON file.

parameter-class

Parameter class. Any parameter in a pharmacometric model.

parameters-class

Parameters class.

Parameters

Create a list of parameters.

parseIfStatement

Parse IF-statement. Assumption: isIfStatement method already called ...

parseStatements

Parse statements code and return Campsis statements.

pattern-class

Pattern class.

Pattern

Create a pattern.

pmx_element-class

PMX element class.

pmx_list-class

PMX list class.

pmx_position_by_element-class

PMX position by element class.

pmx_position_by_index-class

PMX position by index class.

pmx_position-class

PMX position class.

Position

Element position in list.

processDoubleArrayArguments

Process double array arguments.

processExtraArg

Process extra arguments.

processJSONDoubleArrayParameter

Process JSON double array parameter.

properties_record-class

Properties record class.

rate_record-class

(Infusion)-rate record class.

read.allparameters

Read all parameters files at once.

read.campsis

Read a Campsis model.

read.model

Read model file.

read.parameters

Read parameters file.

read.pmxmod

Read a Campsis model (deprecated).

read

Generic read method to read data from a file or a folder.

read.varcov

Read variance-covariance file.

removeNaColumn

Remove given column(s) if it has only NA's.

removeTrailingLineBreaks

Remove all trailing line breaks.

replace

Replace element by another in list.

sampleGeneric

Generic function for parameter sampling according to the minimum and m...

select

Get a subset of an object.

setMinMax

Set the minimum and maximum value on a model parameter.

shiftOmegaIndexes

Shift OMEGA indexes.

sigma-class

Sigma parameter class.

Sigma

Create a SIGMA parameter.

single_array_parameter-class

Single-array parameter class. This parameter has a single index value.

sort

Sort the specified list.

standardise

Standardise.

statements_record-class

Statements record class.

theta-class

Theta parameter class.

Theta

Create a THETA parameter.

toString

ToString generic method.

trim

Trim character vector. Remove all leading and trailing spaces.

unknown_statement-class

Unknown statement class. Any statement not recognized by campsismod.

UnknownStatement

Create a new ordinary differential equation (ODE).

UnsupportedDestException

Unknown destination engine exception.

updateCompartments

Update compartments list from the persisted records. Exported especial...

updateOMEGAs

Update OMEGAs that are same. Same OMEGAs are written as follows: OMEGA...

updateParameters

Update model parameters based on the parameters issued from the model ...

variable_pattern-class

Variable pattern class.

VariablePattern

Create a variable pattern.

variablePatternNoStartStr

Return the variable pattern (string form), without the first character...

variablePatternStr

Return the variable pattern (string form).

write

Write generic object to files.

writeParameters

Write subset of parameters (theta, omega or sigma).

writeRecordDelimiter

Write record delimiter line.

writeVarcov

Write variance-covariance matrix.

contains

Check if an element exists in list.

convertAnyComment

Convert Campsis comment style to C/C++ code. Only the first # is trans...

convertOutvarsToCapture

Convert outvars argument to capture. Variables that are already in err...

default

Get default element from list.

add

Add element to list.

addODECompartment

Add ODE compartment to compartments object.

addProperties

Add properties to compartments object.

addRSE

Add relative standard error (RSE) to the specified parameter.

addSuffix

Generic function to add a suffix to various objects like parameters, c...

allNa

Check is vector has NA's only.

appendCodeRecords

Append code records

appendComment

Append comment.

appendCompartments

Append compartments.

appendModel

Append model (or simply add).

appendParameters

Append parameters.

as.data.frame

As data frame method.

assertSingleCharacterString

Assert the given character vector is a single character string.

AutoReplicationSettings

Create auto replication settings.

Bioavailability

Create a bioavailability for the specified compartment.

campsis_model-class

Campsis model class.

CampsisModel

Create a new Campsis model.

checkMatrixIsPositiveDefinite

Check OMEGA/SIGMA matrix for positive definiteness.

code_record-class

Code record class. See this code record as an abstract class. 2 implem...

CodeRecords

Create a list of code records.

colon-equals

Colon-equals operator.

comment-class

Comment class. A statement starting with #.

Comment

Create a new comment.

compartment_bioavailability-class

Compartment bioavailability class.

compartment_infusion_duration-class

Compartment infusion duration class.

compartment_infusion_rate-class

Compartment infusion rate class.

compartment_initial_condition-class

Compartment initial condition class.

compartment_lag_time-class

Compartment lag time class.

compartment_properties-class

Compartment properties class.

compartment_property-class

Compartment property class.

compartment-class

Compartment class.

Compartment

Create a compartment.

compartments-class

Compartments class.

Compartments

Create a list of compartments

replaceAll

Replace all occurrences in object.

replicate

Replicate generic object.

replicated_campsis_model-class

Replicated Campsis model class.

replication_settings-class

Replication settings interface.

rxode_type-class

RxODE/rxode2 export type class.

rxodeCode

Get code for rxode2

rxodeMatrix

Get the OMEGA/SIGMA matrix for rxode2.

rxodeParams

Get the parameters vector for rxode2.

sampleFromInverseChiSquaredCore

Sample from scaled inverse chi-squared distribution (core method).

sampleFromInverseChiSquaredOrWishart

Sample parameters from inverse scaled chi-squared or wishart distribut...

sampleFromInverseWishartCore

Sample from scaled inverse Wishart distribution (core method).

sampleFromMultivariateNormalDistribution

Sample from a multivariate normal distribution.

sampleFromMultivariateNormalDistributionCore

Sample from multivariate normal distribution (core method).

A generic, easy-to-use and expandable implementation of a pharmacokinetic (PK) / pharmacodynamic (PD) model based on the S4 class system. This package allows the user to read and write pharmacometric models from and to files, including a JSON-based interface to import Campsis models defined using a formal JSON schema distributed with the package. Models can be adapted further on the fly in the R environment using an intuitive API to add, modify or delete equations, ordinary differential equations (ODEs), model parameters or compartment properties (such as infusion duration or rate, bioavailability and initial values). The package also provides export facilities for use with the simulation packages ‘rxode2’ and ‘mrgsolve’. The package itself is licensed under the GPL (>= 3); the JSON schema file shipped in inst/extdata is licensed separately under the Creative Commons Attribution 4.0 International (CC BY 4.0). This package is designed and intended to be used with the package ‘campsis’, a PK/PD simulation platform built on top of ‘rxode2’ and ‘mrgsolve’.

  • Maintainer: Nicolas Luyckx
  • License: GPL (>= 3)
  • Last published: 2026-01-27