R objects are converted to Crunch objects using the following rules:
toVariable(x, ...)# S4 method for character
toVariable(x, ...)
# S4 method for numeric
toVariable(x, ...)
# S4 method for factor
toVariable(x, ...)
# S4 method for Date
toVariable(x, ...)
# S4 method for POSIXt
toVariable(x, ...)
# S4 method for AsIs
toVariable(x, ...)
# S4 method for VariableDefinition
toVariable(x, ...)
# S4 method for logical
toVariable(x, ...)
# S4 method for CrunchExpr
toVariable(x, ...)
the object
additional arguments
a list object suitable for POSTing to the Crunch API. See the API documentation for specifications.
Character vectors are converted into Crunch text variables
Numeric vectors are converted into Crunch numeric variables
Factors are converted to categorical variables
Date and POSIXt vectors are converted into Crunch datetime variables
Logical vectors are converted to Crunch categorical variables
VariableDefinitions are not converted, but the function can still append additional metadata
If you have other object types you wish to convert to Crunch variables,
you can declare methods for toVariable