The type of the new variable can depend on the type(s) of the source
variable(s). By default (type=NULL
), the type of the new variable will be
the type of all of the source variables (that is, if all of the source
variables are text, the new variable type will be text, if all of the
source variables are categorical, the new variable will be categorical).
If there are multiple types in the source variables, the result will be a
text variable. The default behavior can be overridden by specifying
type = "categorical"
, "text"
, or "numeric"
.
conditionalTransform
is similar to makeCaseVariable
; however,
conditionalTransform
can use other Crunch variables as a source of a
variable, whereas, makeCaseVariable
can only use characters. This
additional power comes at a cost: makeCaseVariable
can be executed
entirely on Crunch servers, so no data needs to be downloaded or uploaded
to/from the local R session. conditionalTransform
on the other hand will
download the data necessary to construct the new variable.