Update r script