[R] using imported tables

Mulholland, Tom Tom.Mulholland at dpi.wa.gov.au
Tue Apr 19 08:27:42 CEST 2005


I guess one of the reasons that you have not had a reply is that you have not followed the posting guide. If you give the list something to work with (a small reproducible example)

You use the word package which in R is very precise, but which I think you are using to describe the file you are reading. This amkes it harder for us to understand what your problem is.

if you type ?read.table and read the help you will find that the parameter col.names is a "a vector of optional names for the variables. The default is to use '"V"' followed by the column number." Typically this would look something like col.names = c("ColA","ColB", ..., "ColZ") That is one for each column in the matrix or data.frame.

But I'm guessing. If I saw the code I might see something else that you've done to to see what you mean by "assigns a name to the entire table."

Now's a good time to reread the posting guide, assuming that you have already done so.

Tom



> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Owen Buchner
> Sent: Tuesday, 19 April 2005 10:16 AM
> To: R-help at stat.math.ethz.ch
> Subject: [R] using imported tables
> 
> 
> I've recently found out using read.table i can insert a table 
> into R from a .dat
> file.  The problem i'm having is now that i've got R to read 
> the package i want
> to use the data from each column.  I've tried adding titles 
> to each column
> using col.name, but it assigns a name to the entire table and 
> wont recognize
> the name i gave the table later in programming.  Is there 
> something i'm doing
> wrong or am i missing an important step?  I'd appreciate any help.
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list