updated data and library call in R code