I have a variable (distributor, format = factor) within a data.frame of movies. I want to replace the name of all distributors that are present less than 10 times to 'Small Companies'. I am able to come up with a list and count using
aggregate(data.frame(count = distributor), list(value = distributor), length)
but I am unable to replace within my data.frame.