ChickWeight2 <- as.data.frame(ChickWeight) # because the "groupedData" class calls
# `[.groupedData`, which is different than `[.data.frame`
row.names(ChickWeight2) <- as.numeric(row.names(ChickWeight)) / 1000
centers_by(data = ChickWeight2, vrb.nm = c("weight","Time"), grp.nm = "Chick")
centers_by(data = ChickWeight2, vrb.nm = c("weight","Time"), grp.nm = "Chick",
scale = TRUE, suffix = "_within")
centers_by(data = as.data.frame(CO2), vrb.nm = c("conc","uptake"),
grp.nm = c("Type","Treatment"), scale = TRUE) # multiple grouping columns
Run the code above in your browser using DataLab