Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 'which': invalid number of intervals Calls: which -> cut -> cut.default Execution halted