Hi, I have 5 different files. Each file has about 1000 columns and about 3000 rows. Basically what I want to do is take the average of the 1000 columns and then graph it (line graph). How would I do this for 5 files at the same time and plot the average of the 5 files into one graph. it would be great if you can get me started with a quick code. thanks kylle -- View this message in context: http://www.nabble.com/average-for-files-and-graph-tp25440679p25440679.html Sent from the R help mailing list archive at Nabble.com.
It would be even greater if you could get us started with some commented, minimal, self-contained, reproducible code. -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of kylle345 Sent: Monday, September 14, 2009 1:35 PM To: r-help at r-project.org Subject: [R] average for files and graph Hi, I have 5 different files. Each file has about 1000 columns and about 3000 rows. Basically what I want to do is take the average of the 1000 columns and then graph it (line graph). How would I do this for 5 files at the same time and plot the average of the 5 files into one graph. it would be great if you can get me started with a quick code. thanks kylle -- View this message in context: http://www.nabble.com/average-for-files-and-graph-tp25440679p25440679.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.
Hi, On Sep 14, 2009, at 2:34 PM, kylle345 wrote:> > Hi, > > I have 5 different files. Each file has about 1000 columns and > about 3000 > rows. Basically what I want to do is take the average of the 1000 > columns > and then graph it (line graph). How would I do this for 5 files at > the same > time and plot the average of the 5 files into one graph. > > it would be great if you can get me started with a quick code.You're not doing it at the same time, but doing it sequentially: Step 1: Load the data ?read.table Step 2: Get average of columns in a table ?colMeans Step 3: Plotting. What type of plot do you expect to see? ?plot ?barchart ?barplot ?boxplot ?points ?lines ... -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact