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: [email protected]
> Received: Sunday, 15 June, 2008, 11:02 PM
> 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[ -c(1:25), ] but that
> didn't work.  I
> also tried writting a few functions, for example:
> 
> deleteRows <- function( data, s, e, ) {
> for( i in s:e )
> data[ -i, ]
> }
> deleteRows( ds, 1, 25 )
> 
> But that didn't work either, it only deleted row 25
> (i'm new to writing
> functions).
> Any thoughts on how to solve my problem would be
> appreciated.
> -- 
> View this message in context:
> http://www.nabble.com/Delete-Block-of-Rows-tp17849775p17849775.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> [email protected] 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.

______________________________________________
[email protected] 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