title: Loading R package inside R script
body: <p>I tried several ways on loading few specific packages inside my <code>script.R</code> to run the script in terminal by typing <code>./Rscript script.R</code>. There is no problem with the script but I get an error when I want to load a package e,g <code>tidyverse</code>.</p>
  
  <pre><code>Error: package or namespace load failed for ‘tidyverse’ in rbind(info, getNamespaceInfo(env, "S3methods")):
  number of columns of matrices must match (see arg 2)
  In addition: Warning message:
  package ‘tidyverse’ was built under R version 3.6.0
  </code></pre>
  
  <p>Based on this link <a href="https://stackoverflow.com/questions/58347125/installing-a-package-in-r-inside-a-script">Installing a package in R inside a script</a> I tried to find the location of the library by typing <code>.libPaths()</code> in Rstudio then I gave the path to load the package inside the <code>script.R</code> by typing
  <code>library(tidyverse,lib.loc="/Library/Frameworks/R.framework/Versions/3.6/Resources/library")</code></p>
  
  <p>Again I get the same error.
  Could you please mention where is the mistake happening? Thanks</p>