I read a tab-delimited ASCII table, with a header, into R thus. Table <- read.table(FileName, header=TRUE, sep="\t"); Is there any way I can now retrieve the header. The header information is obviously there since I see it, along with the values of the first row of data, when I type Table[1, ] However, I cannot find an R function to retrieve the header information from "Table". When I try> help.search("header")I get No help files found with alias or title matching `header' I would be grateful if someone could tell me how I might retrieve the header information. Thanks, Peter. =========================================================================== The information contained in this email message is intended only for use by the === recipient(s) to which it is addressed. This message may be privileged and === confidential and protected from disclosure. If the reader of this message is not === the intended recipient or an agent responsible for delivering it to the intended === recipient, you are hereby notified that you have received this document in error === and that any review, retransmission, dissemination, distribution, copying or other === use of, or taking of any action in reliance upon this information, is strictly === prohibited. If you have received this communication in error, please contact the === sender and delete the material from your computer. ========================================================================== -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 5 Aug 2002 PLauren at genelogic.com wrote:> I read a tab-delimited ASCII table, with a header, into R thus. > Table <- read.table(FileName, header=TRUE, sep="\t"); > > Is there any way I can now retrieve the header. The header information is > obviously there since I see it, along with the values of the first row of > data, when I type > Table[1, ] >I think you want names(Table) -thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Just what I wanted. Thanks, Peter. |---------+----------------------------> | | Thomas Lumley | | | <tlumley at u.washin| | | gton.edu> | | | | | | 08/05/02 04:26 PM| | | | |---------+----------------------------> >--------------------------------------------------------------------------------------------------------------| | | | To: PLauren at genelogic.com | | cc: r-help at stat.math.ethz.ch | | Subject: Re: [R] Extracting Header From Table | >--------------------------------------------------------------------------------------------------------------| On Mon, 5 Aug 2002 PLauren at genelogic.com wrote:> I read a tab-delimited ASCII table, with a header, into R thus. > Table <- read.table(FileName, header=TRUE, sep="\t"); > > Is there any way I can now retrieve the header. The header informationis> obviously there since I see it, along with the values of the first row of > data, when I type > Table[1, ] >I think you want names(Table) -thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
I think what you want is names(Table) -----Original Message----- From: PLauren at genelogic.com [mailto:PLauren at genelogic.com] Sent: Tuesday, 6 August 2002 6:12 AM To: r-help at stat.math.ethz.ch Subject: [R] Extracting Header From Table I read a tab-delimited ASCII table, with a header, into R thus. Table <- read.table(FileName, header=TRUE, sep="\t"); Is there any way I can now retrieve the header. The header information is obviously there since I see it, along with the values of the first row of data, when I type Table[1, ] However, I cannot find an R function to retrieve the header information from "Table". When I try> help.search("header")I get No help files found with alias or title matching `header' I would be grateful if someone could tell me how I might retrieve the header information. Thanks, Peter. ========================================================================== The information contained in this email message is intended only for use by the === recipient(s) to which it is addressed. This message may be privileged and === confidential and protected from disclosure. If the reader of this message is not === the intended recipient or an agent responsible for delivering it to the intended === recipient, you are hereby notified that you have received this document in error === and that any review, retransmission, dissemination, distribution, copying or other === use of, or taking of any action in reliance upon this information, is strictly === prohibited. If you have received this communication in error, please contact the === sender and delete the material from your computer. ========================================================================= -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. -.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._._._ ************************************************************************ The information in this e-mail together with any attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any form of review, disclosure, modification, distribution and/or publication of this e-mail message is prohibited. If you have received this message in error, you are asked to inform the sender as quickly as possible and delete this message and any copies of this message from your computer and/or your computer system network. ************************************************************************ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Peter, Try colnames(Table). Beware if you had used lower case t you would have masked the table() R function. Rgds, Matthew -----Original Message----- From: PLauren at genelogic.com [mailto:PLauren at genelogic.com] Sent: 05 August 2002 21:12 To: r-help at stat.math.ethz.ch Subject: [R] Extracting Header From Table I read a tab-delimited ASCII table, with a header, into R thus. Table <- read.table(FileName, header=TRUE, sep="\t"); Is there any way I can now retrieve the header. The header information is obviously there since I see it, along with the values of the first row of data, when I type Table[1, ] However, I cannot find an R function to retrieve the header information from "Table". When I try> help.search("header")I get No help files found with alias or title matching `header' I would be grateful if someone could tell me how I might retrieve the header information. Thanks, Peter. =========================================================================== The information contained in this email message is intended only for use by the === recipient(s) to which it is addressed. This message may be privileged and === confidential and protected from disclosure. If the reader of this message is not === the intended recipient or an agent responsible for delivering it to the intended === recipient, you are hereby notified that you have received this document in error === and that any review, retransmission, dissemination, distribution, copying or other === use of, or taking of any action in reliance upon this information, is strictly === prohibited. If you have received this communication in error, please contact the === sender and delete the material from your computer. ========================================================================== -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. -.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._