Remove groups with less than 4000

It seems like remove.groups is the command I would want to use but does anybody know the syntax for using this command (or whichever command is correct) for removing any groups with less than 4000 sequences?

When you run subsample, any groups with less than the specified sequence number are discarded, e.g.

sub.sample(fasta=XXX, count=XXX, size=4000, persample=T)

You can also use shared files as the input.