Learn R Programming

validate (version 0.1.4)

variables: Extract variable names

Description

Extract variable names

Usage

variables(x, ...)

## S3 method for class 'rule': variables(x, ...)

## S3 method for class 'list': variables(x, ...)

## S3 method for class 'data.frame': variables(x, ...)

## S3 method for class 'environment': variables(x, ...)

## S3 method for class 'expressionset': variables(x, as = c("vector", "matrix", "list"), dummy = FALSE, ...)

Arguments

x
An R object
...
Arguments to be passed to other methods.
as
how to return variables:
  • 'vector'
Return the uniqe vector of variables occurring in x. 'matrix' Return a boolean matrix, each row representing a rule, each column representing a vari

item

dummy

code

:=

Methods (by class)

  • rule: Retrieve unique variable names
  • list: Alias tonames.list
  • data.frame: Alias tonames.data.frame
  • environment: Alias tols
  • expressionset: Variables occuring inxeither as a single list, or per rule.

See Also

description, label, created, origin

Examples

Run this code
v <- validator(
  root = y := sqrt(x)
 , average = mean(x) > 3
 , sum = x + y == z
)
variables(v)
variables(v,dummy=TRUE)
variables(v,matrix=TRUE)
variables(v,matrix=TRUE,dummy=TRUE)

Run the code above in your browser using DataLab