0

The columns have multiple variables, such as the year, the IEA grouping, and the onshore and offshore status. how can i get all of these variables to be their own column and make the data set taller?

Im fairly new R and am somewhat familiar with melting and casting a messy data set but idk how to approach this kind of problem.

basically i would like to have a column for each of the current column variables, which would necessitate way more rows but would make the data much easier to work with.this is the top right corner of the data set. as you can see, each of the columns currently have 6 different variables, and i would like each to have their own column

  • Welcome to Stack Overflow! Could you make your problem reproducible by sharing a sample of your data so others can help (please do not use `str()`, `head()` or screenshot)? You can use the [`reprex`](https://reprex.tidyverse.org/articles/articles/magic-reprex.html) and [`datapasta`](https://cran.r-project.org/web/packages/datapasta/vignettes/how-to-datapasta.html) packages to assist you with that. See also [Help me Help you](https://speakerdeck.com/jennybc/reprex-help-me-help-you?slide=5) & [How to make a great R reproducible example?](https://stackoverflow.com/q/5963269) – Tung Apr 02 '19 at 22:06
  • https://o365coloradoedu-my.sharepoint.com/:t:/g/personal/joga5948_colorado_edu/Ed-4rIl4JDBNmOVsk6r0h9sBYMrnKWoNwEZvD2F6xo6u8Q?e=Z7RTHR – John Gaebler Apr 02 '19 at 22:29

0 Answers0