On Mon, Jul 13, 2009 at 5:55 AM, Weiwei Shi<helprh...@gmail.com> wrote:
> Hi, there:
>
> Assume I have a dataframe with rownames like A with rownames like a to e,
>
>> A
>  [,1] [,2]
> a    1    6
> b    2    7
> c    3    8
> d    4    9
> e    5   10
>
> when I use A[1,], I lost the rowname for it, like below. How could I keep
> it? Is there an easy way instead that I have to modify by myself after I
> used A[1,] manually.
>
>> A[1,]
> [1] 1 6

I think if you do str(A) you'll discover it's a matrix, not a data frame.

Hadley

-- 
http://had.co.nz/

______________________________________________
R-help@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.

Reply via email to