Hi everyone!
I would really appreciate if anyone can guide me towards the right direction.
I am trying to run this code on Rstudio
gap_long <- gap_wide %>%
pivot_longer(
cols = c(starts_with('pop'), starts_with('lifeExp'), starts_with('gdpPercap')),
names_to = "obstype_year", values_to = "obs_values"
)
str(gap_long)
But it gives me this error:
Error in pivot_longer(., cols = c(starts_with("pop"), starts_with("lifeExp"), :
could not find function "pivot_longer"
I've tried installing tidyr but still no hope.