r script patch