[R] ggplot simple question.

John Kane jrkrideau at inbox.com
Sat May 12 17:37:36 CEST 2012


That does not look like a matrix but a data frame.  Do a class(dataname) to check.

It is much better to present the data in a useable format.  Have a look at ?dput for a way to provide the data.

However if we assulme your data is xx, this may do what you want if I understand you correcctly.

xx1  <-data.frame( t(xx[, 2:6]))
xx1[,5]  <- names(xx[2:6])
names(xx1)  <- c(letters[1:4], "Name")
ggplot(xx1, aes(x=factor(Name), a))  + geom_point()

John Kane
Kingston ON Canada


> -----Original Message-----
> From: robinmjelle at gmail.com
> Sent: Sat, 12 May 2012 03:29:35 -0700 (PDT)
> To: r-help at r-project.org
> Subject: [R] ggplot simple question.
> 
> I have a matrix like this
> 
> Name                                   1                            2
> 3                                 4                            5
> NM_001039514	1.033557047	0.7469879518	0.9004524887	0.8613861386
> 0.7952499048
> NM_001039723	1.0759493671	1.2315789474	0.8666666667	1.1142857143
> 0.9428011471
> NM_001042605	0.9897435897	0.8870431894	1.1038062284	0.7407407407
> 0.744530664
> NM_001048207	1.0070422535	0.9319727891	0.9015151515	0.8296438884
> 0.7290217712
> 
> I want to plot each row in a single graph and then use multiplot to put
> them
> all together in a single graph.
> How do you plot the rows?
> 
> 
> --
> View this message in context:
> http://r.789695.n4.nabble.com/ggplot-simple-question-tp4628640.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at 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.

____________________________________________________________
GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys
Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most webmails



More information about the R-help mailing list