Learn R Programming

crunch (version 1.6.1)

variable-to-R: Convert Variables to local R objects

Description

Convert Variables to local R objects

Usage

## S3 method for class 'CrunchVariable':
as.vector(x, mode = "any")

Arguments

x
a CrunchVariable subclass
mode
for Categorical variables, one of either "factor" (default, which returns the values as factor); "numeric" (which returns the numeric values); or "id" (which returns the category ids). If "id", values corresponding to missing categories will return as the

Value

  • an R vector of the type corresponding to the Variable. E.g. CategoricalVariable yields type factor by default, NumericVariable yields numeric, etc.