Minor changes to R scripts