how to create a long format table from multiple columns

166 Views Asked by At

I would like to know, how can I do long format table.

this is what I have:

and this is what I want

if you are asking what I would like to do, it is for ggplot2 proportional stacked area chart. thank you very much

1

There are 1 best solutions below

1
On BEST ANSWER

Try:

library(tidyverse)

your_dataframe%>% pivot_longer(-Date, names_to = "plylum", values_to = "percent")