add warning message to R funciton for input errors