Re: [R] Read.csv

From: Petr Pikal <petr.pikal_at_precheza.cz>
Date: Thu 26 Oct 2006 - 08:02:28 GMT

Hi

On 26 Oct 2006 at 10:31, Wang, Joshua (EQS) wrote:

Date sent:      	Thu, 26 Oct 2006 10:31:00 +0900
From:           	"Wang, Joshua (EQS)" <joshua.wang@gs.com>
To:             	"Murray Pung" <mcpung@gmail.com>
Copies to:      	r-help@stat.math.ethz.ch
Subject:        	Re: [R] Read.csv

> Mr. Pung,
>
> Thank you. It works in terms of loading the data. Except that there is
> a header in the file that I would like to load it to be the names in
> the data.frame.

You probably shall set row.names=NULL parameter in read.csv as stated in help page

row.names a vector of row names. This can be a vector giving the actual row names, or a single number giving the column of the table which contains the row names, or character string giving the name of the table column containing the row names. If there is a header and the first row contains one fewer field than the number of columns, the first column in the input is used for the row names. Otherwise if row.names is missing, the rows are numbered. Using row.names = NULL forces row numbering.

However you probably will always get some row numbering as it is an attribute of data.frame.

HTH
Petr

>
> Regards,
> Josh
>
>
> ________________________________
>
> From: Murray Pung [mailto:mcpung@gmail.com]
> Sent: Thursday, October 26, 2006 10:26 AM
> To: Wang, Joshua (EQS)
> Cc: r-help@stat.math.ethz.ch
> Subject: Re: [R] Read.csv
>
>
> Try:
>
> read.csv("name.csv", header = F)
>
>
> On 26/10/06, Wang, Joshua (EQS) <joshua.wang@gs.com> wrote:
>
> Are there ways to load a csv file without row.names by
> read.csv? Thanks.
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@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
> and provide commented, minimal, self-contained,
> reproducible code.
>
>
>
>
>
> --
> Murray Pung
> Statistician, Datapharm Australia Pty Ltd
> 0404 273 283
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@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 and provide commented,
> minimal, self-contained, reproducible code.

Petr Pikal
petr.pikal@precheza.cz



R-help@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 and provide commented, minimal, self-contained, reproducible code. Received on Fri Oct 27 07:09:38 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 26 Oct 2006 - 23:30:12 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.