I am trying to create a graph for my thesis data and am receiving the error message below. The graph runs, but the equations are not printed on it. I can't figure out what the issue is. There was a row with 'NA', but I removed it manually from the data.frame.
****Warning message:
Computation failed in stat_poly_eq()
:
variable lengths differ (found for '(weights)')****
Any help will be greatly appreciated. The code for my graph that renders the error is below.
scatter.smooth(logspinbossht~logtestdia2)
df6 = data.frame(logtestdia2,logspinbossht)
df6 = df6[-c(574), ] ##remove NA
formula6 = logspinbossht ~ logtestdia2
reg6 = ggplot(df6, aes(x = logtestdia2, y = logspinbossht))+geom_point()+stat_smooth()+stat_poly_eq(aes(label=paste(stat(eq.label),stat(adj.rr.label),sep = "~~~~")),formula=formula6,parse=TRUE)
reg6+ggtitle("Spine Boss Length vs Test Diameter")+xlab("Log Transformed Test Diameter (mm)")+ylab("Log Transformed Spine Boss Length (mm)")