Re: [R] ggplot2 error: arguments imply differing number of rows

2012-04-05 Thread ux.seo
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 +

[R] ggplot2 error: arguments imply differing number of rows

2012-04-05 Thread Debbie Smith
This example is from "The R Book" by Michael J. Crawley. d=read.table( "http://www.bio.ic.ac.uk/research/mjcraw/therbook/data/diminish.txt"; ,header=TRUE) p=qplot(xv,yv,data=d); p m1=lm(yv~xv,data=d) p1=p + geom_abline(intercept=coefficients(m1)[1], slope=coefficients(m1)[2] ); p1 m2=lm(yv~xv + I