Install R packages if necessary