R utility functions to save me time