getvars {regr0}R Documentation

Extract Variables for Model Fitting from a Data Frame

Description

Extracts the variables occurring in a formula, in raw form (as get\_all\_vars) or in transformed form (as model.frame does it).

Usage

getvars(formula, x = NULL, data = NULL, rawvars = TRUE, jitterbinary = TRUE, ...)

Arguments

formula

a model 'formula' or 'terms' object or an R object.

x
data

a data.frame, list or environment (or object coercible by 'as.data.frame' to a data.frame), containing the variables in 'formula'. Neither a matrix nor an array will be accepted.

rawvars

logical. If TRUE, untransformed variables will be extracted, otherwise, variables as transformed in formula.

jitterbinary

logical. Should binary variables be marked to be jittered in plots?

...

further arguments such as data, weight, subset, offset used to create further columns in the resulting data.frame, with parenthesised names such as '"(offset)"'

Value

data.frame containing the extracted variables.

attr(.,"is.fac") characterizes the variables coming from formula: 0 for numeric, 1 for factor, 2 for binary

See Also

model.frame

Examples

data(d.blast)
getvars(log10(tremor)~log10(dist)*log10(charge), data=d.blast)

[Package regr0 version 1.0-5 Index]