normalize_DF | R Documentation |
Normalize variable in a data frame
normalize_DF( data, var.name, method = "mean", norm.number, return = "add.end", digits = 2 )
data |
data frame with numeric variable that should be normalized |
var.name |
character; data frame column name with numeric variable that should be normalized |
method |
character; normalization method; possible values are: |
norm.number |
numeric; a value to normalize to (if |
return |
character; return object; possible values are: |
digits |
integer; number of decimal places to round the normalized value |
This function scales variable to a range of (0-1), where 1 get values that are the most close to mean, median or given number. See normalize for details.
var.name
must be exact column name as in data frame.
Vector or data frame with normalized values.
Elena N. Filatova
data <- data.frame (N = 1:5, temperature = c(37.5, 36.6, 41.2, 38.8, 36.7), name = c("Bob", "Kate", "Steve", "Sonya", "Mary")) normalize_DF (data = data, var.name = "temperature", method = "mean", return = "vector") normalize_DF (data = data, var.name = "temperature", method = "mean", return = "replace") normalize_DF (data = data, var.name = "temperature", method = "mean", return = "add.near") normalize_DF (data = data, var.name = "temperature", method = "number", norm.number = 36.6, return = "add.end")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.