Search code examples
rggplot2stacked-area-chartproportionslong-format-data

how to create a long format table from multiple columns


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


Solution

  • Try:

    library(tidyverse)

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