Displaying 1 result from an estimated 1 matches for "tarifx".
Did you mean:
tarifa
2012 Mar 19
0
Reshape data frame with dcast and melt
...ame and id) is only
unique in the wide form. After applying the
reshape_long function the primary key is not longer unique. I was wondering
if anyone can tell me whether the step
from d1 -> reshape_wide -> d2 can work at all because of the non uniqueness
of d1.
library(reshape2)
library(taRifx)
reshape_long <- function(data, ids) {
# Bring data 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...