Mara Averick on X: "🤔 Need to pivot your data but column headers have variable names AND values? Use ".values" in the names_to argument of pivot_longer()! 📕 Read the details in R4DS (
![Data Analysis and Visualisation in R for Ecologists: Manipulating, analyzing and exporting data with tidyverse Data Analysis and Visualisation in R for Ecologists: Manipulating, analyzing and exporting data with tidyverse](https://datacarpentry.org/R-ecology-lesson/fig/pivot_longer_graphic.png)
Data Analysis and Visualisation in R for Ecologists: Manipulating, analyzing and exporting data with tidyverse
![Data reshaping: from wide to long and back – Introduction to R/tidyverse for Exploratory Data Analysis Data reshaping: from wide to long and back – Introduction to R/tidyverse for Exploratory Data Analysis](https://tavareshugo.github.io/r-intro-tidyverse-gapminder/fig/07-tidyr_pivot.png)
Data reshaping: from wide to long and back – Introduction to R/tidyverse for Exploratory Data Analysis
![dataframe - How to use pivot_longer() in R to separate columns into multiple rows by category? - Stack Overflow dataframe - How to use pivot_longer() in R to separate columns into multiple rows by category? - Stack Overflow](https://i.stack.imgur.com/to5bP.png)