[R] Removing Rows
Petr Pikal
petr.pikal at precheza.cz
Tue Nov 22 08:58:55 CET 2005
Hi
use
selection <- seq(10, final length, 10)
or
selection <- (1:n)*10
and
mydf[selection,]
mydf[-selection,]
HTH
Petr
On 21 Nov 2005 at 15:37, mark salsburg wrote:
Date sent: Mon, 21 Nov 2005 15:37:28 -0500
From: mark salsburg <mark.salsburg at gmail.com>
To: R-help at stat.math.ethz.ch, r-help at stat.math.ethz.ch
Subject: [R] Removing Rows
> I have a data frame with the following dimensions 217 x 5
>
> I want to create two data frames from the original.
>
> 1) One containing every tenth row of the original data frame
> 2) Other containing the rest of the rows.
>
> How do I do this? I've tried subset() and calling the index.
>
> thank you in advance,
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
Petr Pikal
petr.pikal at precheza.cz
More information about the R-help
mailing list