update r script