R scripts updated