R functions used here and there