Re: [R] stacked area chart

2010-09-28 Thread Dimitri Liakhovitski
Thanks a lot, Ista! On Tue, Sep 28, 2010 at 10:00 AM, Ista Zahn wrote: > Hi Dimitri, > I'm not proficient with base graphics, but here is a ggplot solution: > > my.data.m <- melt(my.data, id="date") > my.data.m$pn <- "+" > my.data.m[my.data.m$variable %in% c("y", "z"), "pn"] <- "-" > my.data.m$va

Re: [R] stacked area chart

2010-09-28 Thread Ista Zahn
Hi Dimitri, I'm not proficient with base graphics, but here is a ggplot solution: my.data.m <- melt(my.data, id="date") my.data.m$pn <- "+" my.data.m[my.data.m$variable %in% c("y", "z"), "pn"] <- "-" my.data.m$variable <- factor(my.data.m$variable, levels=c("a", "x", "y", "z")) my.data.m$Date <- a

Re: [R] stacked area chart

2010-09-27 Thread Dimitri Liakhovitski
I found a solution to my original question (see code below). But I have a question about cosmetics, which I always find very challenging. 1. How can I make all dates appear on the X axis (rotated at 90 degrees vs. horizontal)? 2. How can I create vertical grid lines so that at each date there is a

[R] stacked area chart

2010-09-27 Thread Dimitri Liakhovitski
Dear R-ers! Asking for your help with building the stacked area chart for the following simple data (several variables - with date on the X axis): ### Creating a data set my.data<-data.frame(date=c(20080301,20080402,20080503,20090301,20090402,20090503,20100301,20100402,20100503), x=c(1.1,1.0,1.6,

Re: [R] Stacked area chart and legends

2008-10-07 Thread Jim Lemon
mbr wrote: I have found lots of good advice on this forum about stacked area charts but I’ve run into problems with the 2 recommended options: stackploy in plotrix or qplot in ggplot2. I have a many page report that will be in a 2x2 page format “par(mfrow=c(2,2))”” and need one of the page compon

Re: [R] Stacked area chart and legends

2008-10-06 Thread hadley wickham
On Mon, Oct 6, 2008 at 10:54 AM, mbr <[EMAIL PROTECTED]> wrote: > > I have found lots of good advice on this forum about stacked area charts but > I've run into problems with the 2 recommended options: stackploy in plotrix > or qplot in ggplot2. I have a many page report that will be in a 2x2 page

[R] Stacked area chart and legends

2008-10-06 Thread mbr
I have found lots of good advice on this forum about stacked area charts but I’ve run into problems with the 2 recommended options: stackploy in plotrix or qplot in ggplot2. I have a many page report that will be in a 2x2 page format “par(mfrow=c(2,2))”” and need one of the page components to be a