Find rows in a data frame where two columns are equal

Solution 1:

mteq <- mtcars[mtcars$gear==mtcars$carb, ]