Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

VariableDefinition

Construct a variable definition


Description

Crunch variables are created by posting a VariableDefinition to the Crunch server. The VariableDefinition contains the information the server requires to calculate the variable. This can information can either be in the form of the actual data which you would like to include in the variable, or a derivation which tells the server how to derive the new variable from existing ones. This function converts an R vector or set of attributes into a variable definition which can be posted to the server.

Usage

VariableDefinition(data, ...)

VarDef(data, ...)

Arguments

data

an R vector of data to convert to the Crunch payload format. See toVariable for how R data types are converted. This function can also be used to construct a VariableDefinition directly by passing attributes to .... This is only recommended for advanced users who are familiar with the Crunch API.

...

additional attributes to be included in the VariableDefinition

Value

a VariableDefinition object, ready to POST to Crunch.

See Also

toVariable

Examples

VariableDefinition(rnorm(5),
    name = "Some numbers",
    description = "Generated pseudorandomly from the normal distribution"
)
VarDef(
    name = "Integers", values = 1:5, type = "numeric",
    description = "When creating variable definitions with 'values', you must
    specify 'type', and categorical variables will require 'categories'."
)

crunch

Crunch.io Data Tools

v1.28.0
LGPL (>= 3)
Authors
Greg Freedman Ellis [aut, cre], Jonathan Keane [aut], Mike Malecki [aut], Neal Richardson [aut], Gordon Shotwell [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.