# NOT RUN {
df <- data.frame(
Participant = as.factor(rep(1:25, each = 4)),
Condition = base::rep_len(c("A", "B", "C", "D"), 100),
V1 = rnorm(100, 30, .2),
V2 = runif(100, 3, 5),
V3 = rnorm(100, 100, 10)
)
dfZ <- standardize(df)
dfZ <- standardize(df, except = "V3")
dfZ <- standardize(df, except = c("V1", "V2"))
dfZ <- standardize(df, subset = "V3")
dfZ <- standardize(df, subset = c("V1", "V2"))
dfZ <- standardize(df, normalize = TRUE)
# Respects grouping
dfZ <- df %>%
dplyr::group_by(Participant) %>%
standardize(df)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab