ind <- df$id[df$month_key == df$month_key[1]]
df[df$id %in% ind,]
# month_key id
#1 201504 1
#2 201504 2
#3 201505 1
#4 201505 2
7
solved Filter with a condition [closed]
ind <- df$id[df$month_key == df$month_key[1]]
df[df$id %in% ind,]
# month_key id
#1 201504 1
#2 201504 2
#3 201505 1
#4 201505 2
7
solved Filter with a condition [closed]