Updated R file and output data