[R] accessing a data frame with row names
inpost at gmail.com
Tue Jun 1 10:20:35 CEST 2010
On 31/05/2010, Gabor Grothendieck <ggrothendieck at gmail.com> wrote:
> Use read.csv or read.table(..., sep = ","). Also note that if you
> delete the first comma of the header (as in the second example below)
> you won't have to specify row.names since it can figure it out from
> the fact that there is one fewer column name than data fields.
>> Lines <- ",column1,column2
> + row1,0.1,0.2
> + row2,0.3,0.4"
>> read.csv(textConnection(Lines), row.names = 1)
> column1 column2
> row1 0.1 0.2
> row2 0.3 0.4
Thank you. When I enter the command:
The response is:
But I want to receive the row name, i.e.:
 row2 0.4
Is this possible?
More information about the R-help