[R] data.frame, ggplot vs matplot
bolker at ufl.edu
Tue Oct 30 22:55:50 CET 2007
baptiste Auguié-2 wrote:
> I've been trying to use ggplot, but I cannot seem to get my data in
> the correct form. I usually have a vector x, and a matrix y and I
> would usually use matplot(x,y) to plot the columns of y against x.
> Now, if i understand correctly, I should cast x and y into a
> data.frame and do something like ggplot(x,y,data=data). I think I'm
> missing something here: do I really need to reshape y into a single
> vector, replicate x accordingly, and put both vectors in a data frame?
> I've tried it, but the reshape function is still very obscure to me.
> Any help appreciated!
> Small example:
> legend("topleft", "(x,y)", columns)
dataL = melt(dataS,id="x")
View this message in context: http://www.nabble.com/data.frame%2C-ggplot-vs-matplot-tf4721042.html#a13498585
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help