Here are two options in the database: one with ave , where we create a vector that has, for each row in the group, the length of this group ( ave will process its result to fill the group):
subset(DF, ave(seq(Name), Name, FUN=length) > 4)
And one more table , where we count the elements in each group and use %in% to save only rows belonging to groups with a sufficient number of elements.
subset(DF, Name %in% names(table(Name)[table(Name) > 4]))
Both produce:
Name variable.1 1 Kim 64.70395 2 Kim 926.33985 3 Kim 128.66298 4 Kim 290.88859 5 Kim 869.41852 9 Joseph 496.77971 10 Joseph 444.02867 11 Joseph -213.37563 12 Joseph -76.72898 13 Joseph 265.64278 14 Hank -91.64673 15 Hank 170.20975 16 Hank 97.88989 17 Hank 12.06907 18 Hank 402.36173
source share