R learn and test