Hello everyone,
I'm getting this FUN(X[[i]], ...) error since hours and it's driving me crazy
Can someone help me, why the ggplot doesn't work? Thanks you in advance!
Here's the code:
seed$Germination_status <- as.numeric(seed$Germination_status)-1
m1 <- glm(Germination_status~Seed_area+field_beetle*field_warming+Stratification+Warming_Chamber,family="binomial",data=seed,na.action=na.omit)
summary(m1)
ggplot(m1, aes(Seed_area,Germination_status,col=field_beetle)) +
geom_jitter(height = 0.05, alpha = .5) +
geom_smooth(method = "glm", se = T,aes(fill=field_beetle), alpha = .1, method.args = list(family="binomial"))+
scale_colour_manual(name="Field selection treatment",
values = c("no" = "deepskyblue", "yes" = "brown"),
labels =c("Non-beetle","Beetle"))+
scale_fill_manual(name="Field selection treatment",
values = c("no" = "deepskyblue", "yes" = "brown"),
labels =c("Non-beetle","Beetle"),guide=F)+
facet_wrap(~Warming_Chamber)+
xlab("Seed size") + ylab("Pr (germination)")+
theme(axis.title = element_text(size = rel(2.5)))+
theme(axis.text = element_text(size = rel(2)))+
theme( panel.grid.minor = element_blank()
,panel.background = element_rect(fill="white")
,panel.border = element_rect(fill=NA, color = "black"))+
theme(legend.position="top")+
theme(legend.title = element_text(colour="black", size=15,face="bold"))+
theme(legend.text = element_text(colour="black", size=13))
cols <- c("deepskyblue", "brown", "deepskyblue4","brown4")