RE: ggplot2 reporting error on method="loess"

233 views
Skip to first unread message

Mike Dylan

unread,
Nov 29, 2012, 10:25:02 AM11/29/12
to ggp...@googlegroups.com
I am working with a data frame size of 51000 rows. I am trying to do this and getting and error. When I try to do method="lm", it works. Is this a bug?
 
ggplot(x, aes(TimeStamp, Max, group=Host)) + geom_smooth(method="loess", se=F, size=1)

Error in predLoess(object$y, object$x, newx, object$s, object$weights,  :
  NA/NaN/Inf in foreign function call (arg 5)
In addition: There were 13 warnings (use warnings() to see them)

Ben Bolker

unread,
Nov 29, 2012, 10:37:37 AM11/29/12
to ggp...@googlegroups.com
You probably have some Hosts with small/wonky data sets. loess isn't
so robust in that case. If you want still want nonparametric smooths
you can use method="gam" (you'll need to load the mgcv package first)

Don't know if this constitutes a bug per se, although a wishlist item
might be to have this sort of problem detected and caught (possibly
eliminating the smooths on those groups with a warning?)



Reply all
Reply to author
Forward
0 new messages