A set of R functions