replication of key functionality from dplyr and the wider tidyverse using only base R
