Re: [R] remove a row from a dataframe, row names disappear - solution

2010-02-05 Thread Euan Reavie
Thank you Sarah.I'm glad it was a quick fix: On Fri, Feb 5, 2010 at 8:50 AM, Sarah Goslee <> wrote: > You're not only removing a row of data, you are invoking the default > behavior of subset, which is to collapse the subsetted result to the > smallest possible type, which in this case is a vecto

Re: [R] remove a row from a dataframe, row names disappear

2010-02-05 Thread Sarah Goslee
You're not only removing a row of data, you are invoking the default behavior of subset, which is to collapse the subsetted result to the smallest possible type, which in this case is a vector. Vectors have no rows, and thus no row names. You need the drop=FALSE argument, as in ENV <- ENV[-1, , dr

[R] remove a row from a dataframe, row names disappear

2010-02-05 Thread Euan Reavie
I find this odd because it doesn't appear to happen in larger datasets. I have the following data set ENV with the first column set as row.names: > ENV TPlog 001S29H 0.601 002S42H 0.602 003S43S 0.779 004S43S 0.702 005S51H 0.978 006S52P 2.718 If I apply > ENV <- ENV[-1,] # remove f