Select only rows if its value in a particular column is less than the value in the other column

Solution 1:

df[df$aged <= df$laclen, ] 

Should do the trick. The square brackets allow you to index based on a logical expression.

Solution 2:

You can also do

subset(df, aged <= laclen)

Solution 3:

If you use dplyr package you can do:

library(dplyr)
filter(df, aged <= laclen)