search for: formula_sort

Displaying 1 result from an estimated 1 matches for "formula_sort".

Did you mean: formula_norm
2012 Mar 19
0
Reshape data frame with dcast and melt
...into long form data_long <- melt(data, id.vars = ids, variable.name="Data_Points", value.name="value") data_long$value <- as.numeric(data_long$value) # Remove rows were analyte value is NA data_long <- data_long[!is.na(data_long$value), ] # Resort data formula_sort <- as.formula(paste("~", paste(ids, collapse="+"))) data_long <- sort(data_long, f = formula_sort) return(data_long) } reshape_wide <- function(data, ids) { # Bring data into wide form formula_wide <- as.formula(paste(paste(ids, collapse="+")...