Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 206342

Equation on Graph Issue: Computation failed in `stat_poly_eq()`: variable lengths differ (found for '(weights)')

$
0
0

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)")

Viewing all articles
Browse latest Browse all 206342

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>