My completed R file