As you got the error message, to use ggplot function, you had better make a data.frame with your data "d". for example, d[ n x p], n : observations, p : variables n = dim(d) dd = data.frame(x=d[,2:n[2]], y=d[,1]) then, you may get the better result after apply "dd" to the ggplot function.
> p1 + geom_line(aes(x=x,y=predict(m2,list(xv=x))), color="red") Error in data.frame(evaled, PANEL = data$PANEL) : arguments imply differing number of rows: 100, 18 This example is from "The R Book" by Michael J. Crawley. -- View this message in context: http://r.789695.n4.nabble.com/ggplot2-error-arguments-imply-differing-number-of-rows-tp4535261p4535432.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.