Function name is confusing, I suggest "Filter". Also, does it need to be exported and who is the typical user of it? Please add a short code documentation with information