program R- in ggplot restrict y to be >0 in LOESS plot
Posted
by Nate
on Stack Overflow
See other posts from Stack Overflow
or by Nate
Published on 2010-05-05T21:51:12Z
Indexed on
2010/05/05
21:58 UTC
Read the original article
Hit count: 219
Here's my code:
qplot(data=sites, x, y, main="Site 349")
(p <- qplot(data = sites, x, y, xlab = "", ylab = ""))
(p1 <- p + geom_smooth(method = "loess",span=0.5, size = 1.5))
p1 + theme_bw() + opts(title = "Site 349")
Some of the LOESS lines and confidence intervals go below zero, but I would like to restrict the graphics to 0 and positive numbers (because negative do not make sense). How can I do this?
© Stack Overflow or respective owner