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

reshape2 is retired, superceded by tidyr #2

Open
enzedonline opened this issue Dec 15, 2021 · 1 comment
Open

reshape2 is retired, superceded by tidyr #2

enzedonline opened this issue Dec 15, 2021 · 1 comment

Comments

@enzedonline
Copy link

05.03 - Packages.R

reshape2 is retired, superceded by tidyr
ref: https://www.rdocumentation.org/packages/reshape2/versions/1.4.4

tidyr reference:
https://r4ds.had.co.nz/tidy-data.html

@enzedonline
Copy link
Author

In Data Frames Part B, you can achieve the melt equivalent with gather:

> data("iris")
> force("iris")
> library(tidyr)
> iris$ID <- 1:nrow(iris)
> tidyIris <- iris %>% gather(measureType, measure, -ID, -Species)
> View(tidyIris)
> tidyIris[tidyIris$ID==1,]
    Species ID  measureType measure
1    setosa  1 Sepal.Length     5.1
151  setosa  1  Sepal.Width     3.5
301  setosa  1 Petal.Length     1.4
451  setosa  1  Petal.Width     0.2

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

1 participant