Skip to main content
Robert David
Today I accept that for some people, I may be too much or too little. But for the people who deserve me, I am just right.
Asked a question last year

how to subset columns in r?

Where am I?

In answerQA you can ask and answer questions and share your experience with others!

Jose Leo
Accept no one's definition of your life: define yourself.

To combine multiple conditions to subset a data frame using ‘OR’, use the following:

my.data11.frame <- subset(data , V1 > 2 | V2 < 4)

You can also use the filter function from the dplyr package as follows:

library(dplyr) 

filter(data, V1 > 2 | V2 < 4)

Related Questions