Created
March 9, 2021 13:43
-
-
Save b-rodrigues/2130283453834ebdb333707e8949ea73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
data("population") | |
head(population) | |
pop_wide <- population %>% | |
pivot_wider(names_from = country, values_from = population) | |
pop_wide %>% | |
pivot_longer(-year, names_to = "pais", values_to = "população") | |
# -year: select all but the "year" column |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment