Learn R Programming

rmutil (version 1.1.9)

fmobj: Object Finder

Description

fmobj inspects a formula and returns a list containing the objects referred to, with indicators as to which are unknown parameters, covariates, factor variables, and functions.

Usage

fmobj(z, envir=parent.frame())

Value

A list, of class fmobj, containing a character vector (objects) with the names of the objects used in a formula, and logical vectors indicating which are unknown parameters (parameters), covariates (covariates), factor variables (factors), and functions (functions).

Arguments

z

A model formula beginning with ~, either in Wilkinson and Rogers notation or containing unknown parameters.

envir

The environment in which the formula is to be interpreted.

Author

J.K. Lindsey

See Also

finterp

Examples

Run this code
x1 <- rpois(20,2)
x2 <- rnorm(20)
x3 <- gl(2,10)
#
# W&R formula
fmobj(~x1+x2+x3)
#
# formula with unknowns
fmobj(~b0+b1*x1+b2*x2)
#
# nonlinear formulae with unknowns
# log link
fmobj(~exp(b0+b1*x1+b2*x2))

Run the code above in your browser using DataLab