Miscellaneous convenience functions for R