Learn R Programming

crunch (version 1.14.4)

as.vector,CrunchExpr-method: Convert Variables to local R objects

Description

Convert Variables to local R objects

Usage

"as.vector"(x, mode = "any")
"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 underlying integer codes; i.e., the R representation will not have any NAs. Otherwise, missing categories will all be returned NA. For non-Categorical variables, the mode argument is ignored.

Value

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