run r script after data extraction