What is the difference between tidyr and dplyr?

Hi,
I use both tidyr and dplyr. I have an intuitive sense of how the two packages are different, and I have noticed that most of my projects are more tidyr heavy in the beginning. Nevertheless, I occasionally have difficulties remembering what function belongs to which package (e.g. drop_na() )

Can someone give me a short description of how the two packages are different in terms of the tasks they are designed to solve?

Thanks

tidyr is for reshaping data i.e. pivoting longer /wider and nesting and unnesting; dplyr is for everything else

1 Like

Thank you,
Why do you think these functions are in tidyr? I would expect them to be in dplyr.

uncount()
drop_na()
replace_na()

Not that it is a big issue. I am just wondering if there is some hidden connection that I am missing.

Uncount is on par with pivoting longer and unnesting for me. The the others, historic I guess.
I typically load tidyverse and don't worry which subpackage is being called

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.