Learn R Programming

crunch (version 1.14.4)

VariableDefinition: Construct a variable definition with (optional) additional metadata

Description

Construct a variable definition with (optional) additional metadata

Usage

VariableDefinition(data, ...)
VarDef(data, ...)

Arguments

data
an R vector of data to convert to the Crunch payload format. See codetoVariable for how R types are converted. If data is not supplied, you may instead supply values, which will not be converted in any way, nor will extra type information be supplied. Only send values if you know what you're doing. You may also omit both data and values to create an empty variable on the server (all values will be system missing "No Data").
...
additional metadata attributes to send.

Value

a VariableDefinition object, ready to POST to Crunch.

See Also

toVariable

Examples

Run this code
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'.")

Run the code above in your browser using DataLab