Re: [R] Delete Block of Rows

2008-06-16 Thread nmarti
Thanks for all the replies. My data frame is actually 4000 rows and 10 columns. This line, df - subset( df, !( rownames(df) %in% 1:25 ) ) Did not work for me. Is there a certain library I need to load for this to work (I'm assuming there isn't)? I didn't get an error message, warning, or

Re: [R] Delete Block of Rows

2008-06-16 Thread milton ruser
Hi there, The subset function is available on your Base R. So you need not to load any package. May be it is not working because I suppose that your rownames is a sequential one (1...4000). Case it is not true, the command will not work. Anyway, I think that those line that are working find is

[R] Delete Block of Rows

2008-06-15 Thread nmarti
I am trying to delete a section of rows from a data frame (based on no condition). Lets say my data frame has 200 rows and I want to delete rows 1 through 25. How would I do this? I know x[ -1, ] deletes the first row (or any desired row). I tried using different variations of this, like x[

Re: [R] Delete Block of Rows

2008-06-15 Thread milton ruser
Hi there, I donĀ“t know if you are trying to solve the delete job or to test how functions work. If you really want to delete lines from a data.frame, try something like this. rowcount-1:100 x-runif(100) y-runif(100) df-data.frame(cbind(rowcount,x,y)) df.subset-subset(df, !(rownames(df) %in%

Re: [R] Delete Block of Rows

2008-06-15 Thread Wacek Kusnierczyk
nmarti wrote: I am trying to delete a section of rows from a data frame (based on no condition). Lets say my data frame has 200 rows and I want to delete rows 1 through 25. How would I do this? I know x[ -1, ] deletes the first row (or any desired row). I tried using different variations

Re: [R] Delete Block of Rows

2008-06-15 Thread Moshe Olshansky
I believe that x - x[-(1:25),] should work. --- On Sun, 15/6/08, nmarti [EMAIL PROTECTED] wrote: From: nmarti [EMAIL PROTECTED] Subject: [R] Delete Block of Rows To: r-help@r-project.org Received: Sunday, 15 June, 2008, 11:02 PM I am trying to delete a section of rows from a data frame