mercredi 2 août 2017

How can I get rid of rows in a dataset in R if any cell in that row satisfies 1 of 2 conditions?

For instance, if I have the following data set:

A B C D 1 3 6 7 2 2 5 9 3 4 4 6 4 4 5 3 5 3 6 6

Essentially, I want something that searches columns B through D (I don't want it to search column A), and deletes a row if any cell in that row contains a number higher than 6 or lower than 3. In this example, rows 1 and 2 would get deleted. Please help!

Aucun commentaire:

Enregistrer un commentaire