update R scripts