Re: [R] Problems with boxplot in ggplot2:qplot

2010-02-17 Thread Dimitri Shvorob
Thanks a lot, Brian! -- View this message in context: http://n4.nabble.com/Problems-with-boxplot-in-ggplot2-qplot-tp1555338p1558810.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Problems with boxplot in ggplot2:qplot

2010-02-16 Thread Dimitri Shvorob
Now that we have a reproducible example... ;) -- View this message in context: http://n4.nabble.com/Problems-with-boxplot-in-ggplot2-qplot-tp1555338p1557994.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

Re: [R] Problems with boxplot in ggplot2:qplot

2010-02-16 Thread Brian Diggs
On 2/15/2010 2:41 PM, Dimitri Shvorob wrote: > library(sqldf) > library(ggplot2) > > t = data.frame(t = seq.Date(as.Date("2009-01-01"), to = > as.Date("2009-12-01"), by = "month")) > x = data.frame(x = rnorm(5)) > df = sqldf("select * from t, x") A simpler way to get random data that doesn't invo

Re: [R] Problems with boxplot in ggplot2:qplot

2010-02-15 Thread Dimitri Shvorob
library(sqldf) library(ggplot2) t = data.frame(t = seq.Date(as.Date("2009-01-01"), to = as.Date("2009-12-01"), by = "month")) x = data.frame(x = rnorm(5)) df = sqldf("select * from t, x") qplot(factor(df$t), df$x, geom = "boxplot") + theme_bw() qplot(factor(df$t), df$x, geom = "boxplot") + the

Re: [R] Problems with boxplot in ggplot2:qplot

2010-02-15 Thread hadley wickham
Without a reproducible example, it's impossible to give you any more suggestions. Hadley On Mon, Feb 15, 2010 at 2:16 PM, Dimitri Shvorob wrote: > > Trying > > + scale_x_date(format = "%b") > > produces a peculiar result: Apr and Dec facets are labeled "Jan", remaining > labels are blank. > -- >

Re: [R] Problems with boxplot in ggplot2:qplot

2010-02-15 Thread Dimitri Shvorob
Trying + scale_x_date(format = "%b") produces a peculiar result: Apr and Dec facets are labeled "Jan", remaining labels are blank. -- View this message in context: http://n4.nabble.com/Problems-with-boxplot-in-ggplot2-qplot-tp1555338p1556573.html Sent from the R help mailing list archive at N

Re: [R] Problems with boxplot in ggplot2:qplot

2010-02-15 Thread Dimitri Shvorob
Thank you, Hadley. I try jpeg(file, width = 800, height = 600, quality = 100) qplot(factor(closed$close.month), closed$closing.balance, geom = "boxplot", main = "Monthly distributions of closing balances", xlab = "Month", ylab = "Balance, USD") + theme_bw() + scale_x_date(major = "months",

Re: [R] Problems with boxplot in ggplot2:qplot

2010-02-15 Thread hadley wickham
Hi Dimitri, Have you looked at the examples for scale_x_date - http://had.co.nz/ggplot2/scale_date.html? They show you how to both set the limits and control the labels. Hadley On Sun, Feb 14, 2010 at 1:34 PM, Dimitri Shvorob wrote: > > ... Unfortunately, a problem remains: I cannot label x ti

Re: [R] Problems with boxplot in ggplot2:qplot

2010-02-14 Thread Dimitri Shvorob
My bad: once I ran dev.off(), I did get a plot, albeit a blank one. Then I removed xlim - which I put in after qplot's complain about xlim - and voila! Thanks a lot. -- View this message in context: http://n4.nabble.com/Problems-with-boxplot-in-ggplot2-qplot-tp1555338p1555352.html Sent from the

Re: [R] Problems with boxplot in ggplot2:qplot

2010-02-14 Thread Dimitri Shvorob
... Unfortunately, a problem remains: I cannot label x ticks a la 'names.arg = '. month has values like '2009-01-01', '2009-02-01', etc., while I would prefer 'Jan', 'Feb'. Using closed$month = format(closed$month, "%b") disrupts the order of plot's panels, which now follows the alphabetic o

Re: [R] Problems with boxplot in ggplot2:qplot

2010-02-14 Thread baptiste auguie
Hi, it's hard to tell what's wrong without a reproducible example, but I noted two things: - AFAIK there is no plot method for ggplot2. You probably meant print(p) instead - if you map x to factor(month), I think it will be incompatible with your xlim values range(month). HTH, baptiste On 14

[R] Problems with boxplot in ggplot2:qplot

2010-02-14 Thread Dimitri Shvorob
Dataframe closed contains balances of closed accounts: each row has month of closure (Date-type column month) and latest balance. I would like to plot by-month distributions of balances. A qplot call below produces several warnings and no output. Can anyone help? Thank you. PS. A really basic