Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dcast 'sep' argument? #88

Open
biodavidjm opened this issue Sep 12, 2018 · 1 comment
Open

dcast 'sep' argument? #88

biodavidjm opened this issue Sep 12, 2018 · 1 comment

Comments

@biodavidjm
Copy link

As you well know, data.table also has a dcast function. There is one option that it is very helpful:

sep | Character vector of length 1, indicating the separating character in variable names generated during casting. Default is _ for backwards compatibility.

Is there a way to do the same thing with reshape2::dcast? I really like reshape2 and that option for dcast would be really useful.

@cderv
Copy link

cderv commented Sep 12, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants