3 (actually 4) neat R functions