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

type

Change Crunch variable types


Description

Numeric, text, and categorical variables can be cast to one another by assigning them a new "type". This modifies the storage of the data on the server and should only be done in narrow circumstances, as in when importing data from a different file format has resulted in incorrect types being specified.

Usage

type(x)

type(x) <- value

## S4 method for signature 'CrunchVariable'
type(x)

## S4 method for signature 'VariableEntity'
type(x)

## S4 replacement method for signature 'CrunchVariable'
type(x) <- value

Arguments

x

a Variable

value

For the setter, a character value in c("numeric", "text", "categorical")

Value

Getter returns character; setter returns x duly modified.


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.