Error "failed to lock directory"

If you get this message when installing a package:
ERROR: failed to lock directory ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library’ for modifying

Try using:

install.packages(xxx, INSTALL_opts = c('--no-lock'))

or in terminal:

R CMD INSTALL --no-lock xxx

Commentaires