Error FUN(X[[i]], ...)

Hello everyone,

I'm getting this FUN(X[[i]], ...) error since hours and it's driving me crazy :sweat_smile:
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)

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)+
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.title = element_text(colour="black", size=15,face="bold"))+
theme(legend.text = element_text(colour="black", size=13))
cols <- c("deepskyblue", "brown", "deepskyblue4","brown4")

This is probably all that is needed to troubleshoot, minus the geom_jitter, but it is simply too much trouble to reverse engineer in the absence of m1. With a reprex you may attract some answers.

See the FAQ: How to do a minimal reproducible example reprex for beginners.

Thank you for your answer. m1 is defined on top though:
m1 <- glm(Germination_status~Seed_area+field_beetle*field_warming+Stratification+Warming_Chamber,family="binomial",data=seed,na.action=na.omit)

is still invisible to anyone trying to help. Questions in the abstract can be very simple, but not when they involve specific questions of why some function call is or is not working.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.