magic R functions for things various