I want to plot a 100% stacked area chart out of a dataframe, where each row of the df sums up to 1. An example dataframe is here: https://pastebin.com/ADMQP6Nx
What i want ultimately is something like this:
Most solutions i found so far here on SO have a different data.frame structure, where the grouping variables are defined in rows rather than as columns, e.g.:
+--------+-------+-------+
| Period | Group | Value |
+--------+-------+-------+
| 1 | t1 | 0.3 |
| 1 | t2 | 0.1 |
| 1 | t3 | 0.4 |
| 1 | t4 | 0.2 |
| 2 | t1 | 0.5 |
| 2 | t2 | 0.1 |
| 2 | t3 | 0.3 |
| 2 | t4 | 0.2 |
| ... | ... | ... |
+--------+-------+-------+
And they use then ggplot like this:
ggplot(data, aes(x=Period, y=Value, fill=Group)) + geom_area()
Is there a solution without transforming the data frame?