Hi everyone I spent hours trying to figure this out but as a newbie I am stuck... can someone show me the R code for the following: If I had a tab delimited file called "file", containing 3 rows : 9.56 8.67 9.28 8.81 7.93 9.85 8.92 10.19 8.63 6.36 7.29 6.68 7.11 8.04 6.05 7.04 5.80 7.34 3.22 3.22 3.28 4.37 5.21 3.10 3.37 2.56 5.43 How do I import the file, then plot the mean and standard error bars of the data from each row? Thank you so much
On Dec 2, 2010, at 10:36 AM, David Lyon wrote:> Hi everyone > > I spent hours trying to figure this out but as a newbie I am stuck... > can someone show me the R code for the following: > > If I had a tab delimited file called "file",Are you sure that you are not on an OS that hides the file extensions by default?> containing 3 rows : > 9.56 8.67 9.28 8.81 7.93 9.85 8.92 10.19 8.63 > 6.36 7.29 6.68 7.11 8.04 6.05 7.04 5.80 7.34 > 3.22 3.22 3.28 4.37 5.21 3.10 3.37 2.56 5.43 > > How do I import the file, then plot the mean and standard error bars > of the data from each row?If the files name is really "file" then: read.table(file="file", header=FALSE, sep="\t") At this point I will note that this appears to be structured along the lines I might except for a homework problem. I will offer the advice that the plotCI function in package plotrix looks suitable and that we have an extensive collection of documentation suitable for beginners that probably has similar problems worked out:> > > Thank you so much > > ______________________________________________ > 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.David Winsemius, MD West Hartford, CT
Hi r-help-bounces at r-project.org napsal dne 02.12.2010 16:36:09:> Hi everyone > > I spent hours trying to figure this out but as a newbie I am stuck... > can someone show me the R code for the following: > > If I had a tab delimited file called "file", containing 3 rows : > 9.56 8.67 9.28 8.81 7.93 9.85 8.92 10.19 8.63 > 6.36 7.29 6.68 7.11 8.04 6.05 7.04 5.80 7.34 > 3.22 3.22 3.28 4.37 5.21 3.10 3.37 2.56 5.43 > > How do I import the file, then plot the mean and standard error bars ofthe> data from each row?Here is how I found how to do it test=read.table("clipboard") test V1 V2 V3 V4 V5 V6 V7 V8 V9 1 9.56 8.67 9.28 8.81 7.93 9.85 8.92 10.19 8.63 2 6.36 7.29 6.68 7.11 8.04 6.05 7.04 5.80 7.34 3 3.22 3.22 3.28 4.37 5.21 3.10 3.37 2.56 5.43 test1<-t(test) ??error library(Hmisc) ?errbar starting httpd help server ... done test.m<-colMeans(test1) test.sd<-apply(test1, 2, sd) errbar(1:3, test.m, test.m+test.sd, test.m-test.sd) Is it OK? Regards Petr> > > Thank you so much > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
Thanks David Do you have the url link that details the worked solution to my problem: "that we have an extensive collection of documentation suitable for beginners that probably has similar problems worked out:" If not can someone show me how to " How do I import the file, then plot the mean and standard error bars of the data from each row?" Thanks in advance. Also this is not an homework problem just somebody using it as a newbie at work in research who normally codes in C, C++ and JAVA. Thanks again. --- On Thu, 12/2/10, David Winsemius <dwinsemius at comcast.net> wrote:> From: David Winsemius <dwinsemius at comcast.net> > Subject: Re: [R] Please help......barplot2 > To: "David Lyon" <david_lyon3 at yahoo.com> > Cc: r-help at r-project.org > Date: Thursday, December 2, 2010, 10:57 AM > > On Dec 2, 2010, at 10:36 AM, David Lyon wrote: > > > Hi everyone > > > > I spent hours trying to figure this out but as a > newbie I am stuck... > > can someone show me the R code for the following: > > > > If I had a tab delimited file called "file", > > Are you sure that you are not on an OS that hides the file > extensions by default? > > > > containing 3 rows : > > 9.56??? 8.67??? > 9.28??? 8.81??? > 7.93??? 9.85??? > 8.92??? 10.19??? > 8.63??? > > 6.36??? 7.29??? > 6.68??? 7.11??? > 8.04??? 6.05??? > 7.04??? 5.80??? > 7.34??? > > 3.22??? 3.22??? > 3.28??? 4.37??? > 5.21??? 3.10??? > 3.37??? 2.56??? > 5.43??? > > > > How do I import the file, then plot the mean and > standard error bars of the data from each row? > > If the files name is really "file" then: > > read.table(file="file", header=FALSE, sep="\t") > > At this point I will note that this appears to be > structured along the lines I might except for a homework > problem. I will offer the advice that the plotCI function in > package plotrix looks suitable and that we have an extensive > collection of documentation suitable for beginners that > probably has similar problems worked out: > > > > > > > > Thank you so much > > > > ______________________________________________ > > 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. > > David Winsemius, MD > West Hartford, CT > >