[R] how to remove rows in which 2 or more observations are smaller than a given threshold?

hind lazrak hindstata at gmail.com
Sun Feb 27 00:37:25 CET 2011


Hello

The data set I am examining has 7425 observations (rows with unique
identifiers) and 46 samples(columns).

I have been trying to generate a dataset that filters out observations
that are "negligible"
The definition of "negligible" is absolute value less or equal  to 1.58.

The rule that I would like to adopt to create a new data is: drop rows
in which 2 or more observations have absolute values <= 1.58.

Since I have unique identifier per row, I have tried to reshape the
data so I could create a new variable using an ifelse statement that
would flag observations <=1.58 but I am not getting anywhere with this
approach

I could not come up with an apply function that counts the number of
observations for which the absolute values are below the cutoff I've
specified.

All observations are numerical and  I don't have missing values.


Thank you in advance for the help,

Hind



More information about the R-help mailing list