Learn R Programming

editrules (version 2.9.5)

getVars: get names of variables in a set of edits

Description

get names of variables in a set of edits

getr variable names

get variable names

Usage

getVars(E, ...)

# S3 method for editset getVars(E, type = c("all", "num", "cat", "mix", "dummy"), ...)

# S3 method for `NULL` getVars(E, ...)

Value

character vector with the names of the variables.

Arguments

E

editset, editmatrix, or editarray

...

Arguments to be passed to or from other methods

type

(editset- or list only) select which variables to return. all means all (except dummies), num means all numericals, cat means all categoricals, mix means those numericals appearing in a logical constraint and dummy means dummy variables connecting the logical with numerical constraints.

See Also

getA, getb, getAb, getOps

Examples

Run this code

E <- editmatrix(c( "x+3*y == 2*z"
                 , "x > 2")
                 )
getVars(E)

E <- editarray(expression(
    gender %in% c('male','female'),
    pregnant %in% c(TRUE, FALSE),
    if( gender == 'male' ) pregnant == FALSE
    )
)

getVars(E)

Run the code above in your browser using DataLab