AllVariablesNames: Find the names of the variables in a formula

View source: R/properties.R

AllVariablesNamesR Documentation

Find the names of the variables in a formula

Description

Handles . on right hand side of formula and $ within backticks in variable names.

Usage

AllVariablesNames(formula, data = NULL)

Arguments

formula

A formula.

data

A data.frame from which to extract variable names if . is used in the formula.

Value

A character vector of variable names appearing in formula.

Examples

dat <- data.frame("dat$Var$y" = 1, x = 2, "`dat$Var$z`" = 3,
                               check.names = FALSE)
AllVariablesNames(`dat$Var$y` ~ ., data = dat)
AllVariablesNames(`dat$Var$y` ~ `dat$Var$z`, data = dat)
AllVariablesNames(`dat$Var$y` ~ `dat$Var$z`*x)
AllVariablesNames(log(y)~I(x^2))

Displayr/flipU documentation built on March 2, 2024, 4:35 a.m.