Update cv.R

Change the condition of termination, for large data