Learn R Programming

crunch (version 1.18.0)

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

Description

Convert Variables to local R objects

Usage

# S4 method for CrunchExpr
as.vector(x, mode = "any")

# S4 method for 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 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.