formula {pim}R Documentation

Extract the formula from a pim or pim.formula object

Description

This function allows you to extract a formula from a pim or a pim.formula object. In the latter case, you extract the original formula.

Usage

formula(x, ...)

## S4 method for signature 'pim'
formula(x, orig = FALSE, ...)

## S4 method for signature 'pim.formula'
formula(x, ...)

Arguments

x

a pim or pim.formula object

...

arguments passed to other methods

orig

a locigal value indicating whether the original formula (TRUE) or the pim.formula object (FALSE) should be returned. Defaults to FALSE

Details

This function is based on formula from the stats package. It creates a generic and can hence be used more or less in the same way. Yet, as the pim package is dependent on the correct binding between the formula objects and different environments, it is advised not to change the environments tied to the formulas and to use this function only to extract the desired information.

Value

a pim.formula if x is a pim object and orig = TRUE. Otherwise a formula object.

See Also

pim.formula-class and pim-class for more information on the classes.

Examples

data("DysData")
themodel <- pim(SPC_D2 ~ Chemo, data = DysData)

thepimform <- formula(themodel)
formula(thepimform)
formula(themodel, orig = TRUE)


[Package pim version 2.0.2 Index]