can we please include an option to turn a dataset 90 degrees, to so turn rows into columns and colums into rows, so statistics and graphs can be performed on ids as well as variables.
Suggested code of a DS dataset
transpose dataset
DS_t <- as.data.frame(t(DS))
move row names into a column (new IDs)
DS_t$ID <- rownames(DS_t)
reset rownames
rownames(DS_t) <- NULL
optional: reorder to have ID as first column
DS_t <- DS_t[, c(ncol(DS_t), 1:(ncol(DS_t)-1))]
can we please include an option to turn a dataset 90 degrees, to so turn rows into columns and colums into rows, so statistics and graphs can be performed on ids as well as variables.
Suggested code of a DS dataset
transpose dataset
DS_t <- as.data.frame(t(DS))
move row names into a column (new IDs)
DS_t$ID <- rownames(DS_t)
reset rownames
rownames(DS_t) <- NULL
optional: reorder to have ID as first column
DS_t <- DS_t[, c(ncol(DS_t), 1:(ncol(DS_t)-1))]