Displaying 1 result from an estimated 1 matches for "data_wid".
Did you mean:
data_id
2012 Mar 19
0
Reshape data frame with dcast and melt
...uot;, 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="+"), "~
Data_Points"))
data_wide <- dcast(data, formula_wide)
# Resort data
formula_sort <- as.formula(paste("~", paste(ids, collapse="+")))
data_wide <- sort(data_wide, f = formula_sort)
return(data_wide)
}
d <- data.frame(
test_name = c(rep("Test_A", 6), rep("...