Some helper functions for interacive R