[R] moving the x-axis in ggplot

2010-05-19 Thread Liam Blanckenberg
Dear all, I was wondering if there is an easy way to set the position of the x-axis in ggplot with respect to where it intercepts the y-axis? The default is for the x-axis to be positioned at the bottom of the chart, but I would like to force it to intercept at y = 0 (I have both positive and nega

[R] ggplot and scale_x_date

2010-04-20 Thread Liam Blanckenberg
Hi all, I have a question about setting arbitrary breaks/labels when using GGPLOT and date/time data on the x-axis. I want to specify the breaks/limits arbitrarily rather than using scale_x_date(major = 'blah'), much like when arbitrarily defining breaks/labels using scale_x_discrete(breaks = blah

[R] Help with lsei() from package limSolve()

2010-02-15 Thread Liam Blanckenberg
Hi all, The problem I am trying to solve is the following: I have a 'trace' of half-hourly data across an entire year - i.e. I have 17,500 observations (one for every half-hour of every day of a year). The data follows a daily, weekly and seasonal pattern that is important to preserve. What I want

Re: [R] ggplot2 stacked line plot

2010-02-10 Thread Liam Blanckenberg
nt, either. I'd suggest using cumsum() to get cumulative totals > and using geom_line() instead; it would probably be less work...as in: > > library(ggplot2) > data2 <- ddply(data.set, .(Time), transform, Csum = cumsum(Value)) > ggplot(data2, aes(x = Time, y = Csum, color = Ty

Re: [R] ggplot2 stacked line plot

2010-02-09 Thread Liam Blanckenberg
kham wrote: > 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 ou

Re: [R] ggplot2 stacked line plot

2010-02-09 Thread Liam Blanckenberg
n Wed, Feb 10, 2010 at 1:53 AM, hadley wickham wrote: > 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. > >

[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(~,

[R] odbcConnectExcel2007 connection error

2010-02-02 Thread Liam Blanckenberg
Hi all, Apologies if I violate any posting etiquette - this is my first submission to the R mailing list. I regularly use 'odbcConnectExcel2007' (from package 'RODBC') to read data from named ranges in excel workbooks into R. I recently received the following error message when attempting to set u