-1

I know there are already some severel questions about this theme, but i still can't get mine to work.

I have this data.frame of some Standard Deviation

df_sd_ <- data.frame(data = c("Oct","Nov","Dec","Jan"), 
                       Rent = c(2.84,0.87,1.03,1.31),
                       Ibov = c(3.64,2.42,1.62,2.03), 
                       NTNB = c(1.61,1.25,1.58,0.64))

And i need to plot a stacked area chart, similar to this:

enter image description here

joran
  • 169,992
  • 32
  • 429
  • 468

2 Answers2

1

Here is an example from R graphics cookbook.

Library(ggplot2)
library(gcookbook)

head(uspopage)

ggplot(uspopage, aes(x=Year, y=Thousands, fill=AgeGroup)) + geom_area()

then you will get something like this

enter image description here

Samehmagd
  • 473
  • 1
  • 5
  • 13
0

My humble advice - you should make your data (df_sd_) tidy first, and then put it to ggplot. Read about and then use pivot_longer function.

  • 2
    From Review: Hi, this post does not seem to provide a [quality answer](https://stackoverflow.com/help/how-to-answer) to the question. Please either edit your answer and improve it, or just post it as a comment to the question. – sɐunıɔןɐqɐp Sep 07 '20 at 13:11