Dear Kristi,
You could do something like this.
ggplot(dat1, aes(x = factor(site), y = Present)) +
geom_boxplot(aes(colour = layer)) +
geom_line(data = dat2, aes(group = 1, y = present)) +
geom_point(data = dat2, aes(y = present))
Note that
- ggplot provides no second axis
- the boxplots di
Hi Kristi
Jim has given you 1 non ggplot2 solution here is one from lattice
panel.average is a line so added a line for points
# convert site to a factor
dat1$Site = factor(dat1$Site)
datav <- aggregate(Present ~ Site, dat1,mean)
datav
diff(datav[,2]) # test
bw1 <-
bwplot(Present~Site,dat
On Jan 27, 2014, at 3:13 AM, Kristi Glover wrote:
> Hi R Users,
> I was struggling to overlay two graphs created from the two different dataset
> using ggplot2. Furthermore, I could not join means of the box plots.
>
> I tried this way but did not work. Any suggestions?
> dat1<-structure(list(s
3 matches
Mail list logo