View source: R/scalevariableset.R
ScaleVariableSet | R Documentation |
Given a Displayr Variable Set or Q Question, performs a specified scaling on the data; first converting any categorical variables to numeric as necessary.
ScaleVariableSet(
data,
type = c("standardize", "center", "unit", "rank"),
within.case = FALSE
)
data |
A Displayr Variable Set or Q Question: A numeric or factor vector, or a data.frame containing either all numeric columns or all factor columns. |
type |
Character string specifying the type of scaling to
perform; one of |
within.case |
Logical; should the scaling be performed within
case (rows) or variables (columns). An error is thrown if
|
A numeric vector if data
contains only a single
variable or a data.frame containing the scaled values.
scale
, numbersFromCategoricalVariableSets
x <- structure(c(1, 2, 3, 4, 5), questiontype = "Number",
dataset = "dat", name = "x", label = "x", question = "x")
ScaleVariableSet(x, type = "unit")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.