transform_cues | R Documentation |
If the 'transform.parameters' argument is specified, the transforms in that object will be applied. This can be useful when the goal is to transform one data set (e.g., test data) based on the statistics of the another data set (e.g., exposure data). If no 'transform.parameters' are specified, then the transformations specified by the 'center', 'scale', and 'pca' flags will be applied. The transform and untransform functions can also return functions that perform their actions for the specific cues. This can be helpful if one wants to store those functions. For example, the transform function can return both the transform and untransform functions necessary to perform the specified centering, scaling, and/or pca and to undo those transformations.
transform_cues(
data,
cues,
center = if (pca) T else F,
scale = F,
pca = F,
attach = T,
transform.parameters = NULL,
return.transformed.data = T,
return.transform.parameters = F,
return.transform.function = F,
return.untransform.function = F
)
untransform_cues(
data,
cues,
uncenter = NULL,
unscale = NULL,
unpca = NULL,
attach = T,
transform.parameters = NULL,
return.untransformed.data = T,
return.untransform.function = F
)
data |
'tibble' or 'data.frame'. |
cues |
Vector of characters with names of cue variables. |
center , uncenter |
Should the data be (un)centered? (default: 'TRUE' unless 'pca = TRUE') |
scale , unscale |
Should the data be (un)standardized? (default: 'TRUE' unless 'pca = TRUE') |
pca , unpca |
Should the data be transformed into/back from orthogonal principal components? If 'TRUE'
then |
attach |
Should the transformed cues be attached to |
transform.parameters |
List of transforms (default: 'NULL') |
return.transformed.data , return.transformed.data |
Should the (un)transformed data be returned? (default: 'TRUE') |
return.transform.parameters |
Should the list of transforms be returned? (default: 'FALSE') |
return.transform.function , return.untransform.function |
Should a function that applies the (un)transform be returned? (default: 'FALSE') |
By default a data.frame
. If 'return.transform.parameters = TRUE', a list of parameters. If
'return.transform.function = TRUE' or 'return.untransform.function = TRUE' a function. If more than one of
these flags is 'TRUE' then a list in which
the data element has name "data", the transform parameters have name "transform.parameters" and the (un)transform
function(s) have the name "(un)transform.function".
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.