Open biodavidjm opened 6 years ago
Not a direct answer but for information, know that tidyr
is replacing reshape2
and is part of the tidyverse. See tidyr's README
tidyr replaces reshape2 (2010-2014) and reshape (2005-2010). Somewhat counterintuitively each iteration of the package has done less. tidyr is designed specifically for tidying data, not general reshaping (reshape2), or the general aggregation (reshape).
I point to this because the tidyr
📦 has a spread
function that act like dcast
and have a sep
argument to do what you are look for. See tidyr reference about spread
As you well know,
data.table
also has adcast
function. There is one option that it is very helpful:Is there a way to do the same thing with
reshape2::dcast
? I really likereshape2
and that option fordcast
would be really useful.