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 2 years ago

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.data15.frame <- subset(data , V1 > 2 | V2 < 4)

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


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