Updates to R scripts