[R] two graphs in one figure?
h.wickham at gmail.com
Thu Apr 10 17:34:43 CEST 2008
On Thu, Apr 10, 2008 at 8:36 AM, ONKELINX, Thierry
<Thierry.ONKELINX at inbo.be> wrote:
> Dear Anne-Katrin,
> You could use ggplot to do this. The example below works, although it generates some warnings.
> dataset <- data.frame(x = 0:55, y = rnorm(56, 10), z = runif(56, 9, 11))
> ggplot(data = dataset) + geom_bar(aes(x = factor(x), y = y), position = "dodge") + geom_line(aes(x = x, y = z))
ggplot(data = dataset, aes(factor(x), y)) + geom_bar() +
does basically the same thing, but without warnings.
More information about the R-help