Re: [R] ggplot2 stacked line plot

2010-02-10 Thread Liam Blanckenberg
Many thanks for you help on this Dennis. Liam On Thu, Feb 11, 2010 at 6:02 AM, Dennis Murphy wrote: > Hi: > > This is closer, but it is still not what you want; it does, however, show > what > geom_area is doing when it renders the plot, as can be seen by the colors. > > data.set <- data.frame

Re: [R] ggplot2 stacked line plot

2010-02-10 Thread Dennis Murphy
Hi: This is closer, but it is still not what you want; it does, however, show what geom_area is doing when it renders the plot, as can be seen by the colors. data.set <- data.frame( Time = c(rep(1, 4),rep(2, 4), rep(3, 4), rep(4, 4)), Type = rep(c('a', 'b', 'c', 'd'), 4), Value = c(10, 12,

Re: [R] ggplot2 stacked line plot

2010-02-09 Thread Liam Blanckenberg
Hi Hadley, Thank you for taking the time to help me with this - I've constructed the following example to illustrate my problem: require(ggplot2) data.set <- data.frame( Time = c(rep(1, 4),rep(2, 4), rep(3, 4), rep(4, 4)), Type = rep(c('a', 'b', 'c', 'd'), 4), Value = c(10, 12, 14, 16, 14, 14

Re: [R] ggplot2 stacked line plot

2010-02-09 Thread hadley wickham
Hi Liam, Yes, that's what that code should do. Could you please send a small reproducible example? Hadley On Tue, Feb 9, 2010 at 4:21 PM, Liam Blanckenberg wrote: > Hadley, > > Thanks for the pointing that error out to me. Unfortunately, revising > my code to: > > p <- ggplot2(~, aes(x = ~, y

Re: [R] ggplot2 stacked line plot

2010-02-09 Thread Liam Blanckenberg
Hadley, Thanks for the pointing that error out to me. Unfortunately, revising my code to: p <- ggplot2(~, aes(x = ~, y = ~, colour = Type)) + geom_line(aes(colour = Type), position = 'stack') still does not generate what I'm after. I'm essentially after a line plot where each 'Type' ('series' in

Re: [R] ggplot2 stacked line plot

2010-02-09 Thread hadley wickham
Hi Liam, Your syntax is a little off. You want: p <- ggplot2(~, aes(x = ~, y = ~, colour = Type)) + geom_area(aes(fill = Type), position = 'stack') Position isn't an aesthetic. Hadley On Sun, Feb 7, 2010 at 10:40 PM, Liam Blanckenberg wrote: > Hi all, > > I have been hunting around for hou

Re: [R] ggplot2 stacked line plot

2010-02-07 Thread Jim Lemon
On 02/08/2010 03:40 PM, Liam Blanckenberg wrote: Hi all, I have been hunting around for hours trying to figure out how to generate a stacked line chart using ggplot2. This type of chart can be generated in excel 2007 by selecting: Chart type> Line> Stacked line. I can generate a stacked area c

Re: [R] ggplot2 stacked line plot

2010-02-07 Thread Steve Lianoglou
Hi, On Sun, Feb 7, 2010 at 11:40 PM, Liam Blanckenberg wrote: > Hi all, > > I have been hunting around for hours trying to figure out how to > generate a stacked line chart using ggplot2. This type of chart can be > generated in excel 2007 by selecting: Chart type > Line > Stacked > line. I can g

[R] ggplot2 stacked line plot

2010-02-07 Thread Liam Blanckenberg
Hi all, I have been hunting around for hours trying to figure out how to generate a stacked line chart using ggplot2. This type of chart can be generated in excel 2007 by selecting: Chart type > Line > Stacked line. I can generate a stacked area chart using the following code: p <- ggplot2(~,