> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Payam Minoofar
> Sent: Wednesday, September 02, 2009 10:09 AM
> To: r-help@r-project.org
> Subject: [R] pruning data
>
> Hello everyone,
>
> I a
Payam -
Take a look at na.omit . This is exactly what it
was written for.
- Phil
On Wed, 2 Sep 2009, Payam Minoofar wrote:
Hello everyone,
I am trying to prune a data frame for partial least squares analysis.
I need to delete an entire row if one cell i
Try this:
DF[complete.cases(DF),]
On Wed, Sep 2, 2009 at 2:09 PM, Payam Minoofar
wrote:
> Hello everyone,
>
> I am trying to prune a data frame for partial least squares analysis.
> I need to delete an entire row if one cell in the row contains a NA.
>
> Presently, I am running a loop that is su
Dear Payam,
Here is a suggestion:
index <- apply(yourdata, 1, function(x) any( is.na(x) ) )
yourdata[ !index, ]
Above creates an index (TRUE) when any row of the data contains a missing
value. Then it filters up (extract) the rows that have complete
observations.
See ?any, ?is.na, ?"!" and ?appl
?is.na
?sum
?if
?else
I think that is how I would approach it, but I could be far off.
On Wed, Sep 2, 2009 at 12:09 PM, Payam
Minoofar wrote:
> Hello everyone,
>
> I am trying to prune a data frame for partial least squares analysis.
> I need to delete an entire row if one cell in the row contain
Hello everyone,
I am trying to prune a data frame for partial least squares analysis.
I need to delete an entire row if one cell in the row contains a NA.
Presently, I am running a loop that is supposed to extract the rows
that are full of numbers into a second data frame and skips the rows
6 matches
Mail list logo