specify the limits calculated for the 'boxplots' using 5%, 25%,75%, 95%
limits as we have with the 'boxplots'.
>
> Tom
>
> - Original Message -
> From: Hadley Wickham
> Date: Tuesday, October 4, 2011 10:23 am
> Subject: Re: [R] Question about gg
Dennis & Hadley,
This does exactly what I need — thank you so much!
Regards,
Tom
On 10/4/11 5:34 PM, Dennis Murphy wrote:
Hi Hadley:
When I tried your function on the example data, I got the following:
dd<- data.frame(year = rep(2000:2008, each = 500), y = rnorm(4500))
g<- function(df, qs
previous email where I can
specify the limits calculated for the 'boxplots' using 5%, 25%,75%, 95% limits
as we have with the 'boxplots'.
Tom
- Original Message -
From: Hadley Wickham
Date: Tuesday, October 4, 2011 10:23 am
Subject: Re: [R] Question about ggplot2 and
Hi Hadley:
When I tried your function on the example data, I got the following:
dd <- data.frame(year = rep(2000:2008, each = 500), y = rnorm(4500))
g <- function(df, qs = c(.05, .25, .50, .75, .95)) {
data.frame(q = qs, quantile(d$y, qs))
}
ddply(dd, .(year), g)
> ddply(dd, .(year), g)
year
> # Function to compute quantiles and return a data frame
> g <- function(d) {
> qq <- as.data.frame(as.list(quantile(d$y, c(.05, .25, .50, .75, .95
> names(qq) <- paste('Q', c(5, 25, 50, 75, 95), sep = '')
> qq }
You could cut out the melt step by making this return a data frame:
g <
m my previous email where I can
> specify the limits calculated for the 'boxplots' using 5%, 25%,75%, 95%
> limits as we have with the 'boxplots'.
>
> Tom
>
> - Original Message -
> From: Hadley Wickham
> Date: Tuesday, October 4, 2011 10:2
ious email where I can
specify the limits calculated for the 'boxplots' using 5%, 25%,75%, 95% limits
as we have with the 'boxplots'.
Tom
- Original Message -
From: Hadley Wickham
Date: Tuesday, October 4, 2011 10:23 am
Subject: Re: [R] Question about ggplot2 and stat_
On Mon, Oct 3, 2011 at 12:24 PM, Thomas Adams wrote:
> I'm interested in creating a graphic -like- this:
>
> c <- ggplot(mtcars, aes(qsec, wt))
> c + geom_point() + stat_smooth(fill="blue", colour="darkblue", size=2, alpha
> = 0.2)
>
> but I need to show 2 sets of bands (with different shading) u
Hi,
Try some like this:
c <- ggplot(mtcars, aes(qsec, mpg, colour=factor(cyl)))
c + stat_smooth(aes(group=cyl))+stat_smooth(aes(fill=factor(cyl)))+geom_point()
Andrés AM
2011/10/3, Thomas Adams :
> I'm interested in creating a graphic -like- this:
>
> c <- ggplot(mtcars, aes(qsec, wt))
> c
Andrés,
Thank you for your help, but that does not capture what I'm looking for. I need
to be able to control the
shaded bound limits and they need to be coincident.
Tom
On 10/3/11 3:37 PM, Andrés Aragón wrote:
Hi,
Try some like this:
c<- ggplot(mtcars, aes(qsec, mpg, colour=factor(cyl)))
Hi:
I would think that, at least in principle, this should work:
a <- ggplot(mtcars, aes(qsec, wt))
a + geom_point() + stat_smooth(fill="blue", colour="darkblue", size=2,
level = 0.9, alpha = 0.2) +
stat_smooth(fill = 'blue', colour = 'darkblue', size = 2,
I'm interested in creating a graphic -like- this:
c <- ggplot(mtcars, aes(qsec, wt))
c + geom_point() + stat_smooth(fill="blue", colour="darkblue", size=2,
alpha = 0.2)
but I need to show 2 sets of bands (with different shading) using 5%,
25%, 75%, 95% limits that I specify and where the hea
12 matches
Mail list logo