Cannot install R packages on a mac

539 views
Skip to first unread message

Jeff Adler

unread,
Dec 12, 2016, 4:31:44 PM12/12/16
to CorpLing with R
Whenever I try to install packages on R on a mac (note: macOS Sierra, Version 10.12), I get the following error message (this happens with any package I attempt to install):


> install.packages("dplyr", "XML", "xml2", "rChoiceDialogs", "stringi", "stringr", "gsubfn", "stringdist", dependencies=TRUE)
Warning in install.packages("dplyr", "XML", "xml2", "rChoiceDialogs", "stringi",  :
  'lib = "XML"' is not writable
Would you like to use a personal library instead?  (y/n) y
Error in available[p1, dependencies, drop = FALSE] : 
  incorrect number of dimensions
In addition: Warning message:
package ‘dplyr’ is not available (for R version 3.3.2) 

Stefan Th. Gries

unread,
Dec 12, 2016, 4:36:57 PM12/12/16
to CorpLing with R
Does that also happen when you start R with administrator rights? On Windows, you might want to right-click on R and choose "start R with administrator rights", on Linux, you might start R from the terminal with sudo R. Also, check the result of .libPaths() to see whether you have write access to those locations.

Jeff Adler

unread,
Dec 12, 2016, 5:01:49 PM12/12/16
to CorpLing with R
Yes, when I start with sudo R, I get the same error message.

When I run .libPaths(), I get:

[1] "/Users/jeffadler/Library/R/3.3/library"                        

[2] "/Library/Frameworks/R.framework/Versions/3.3/Resources/library"


If I use the ls -l command with the former path, nothing happens: 

Macintosh-8:library jeffadler$ cd /Users/jeffadler/Library/R/3.3/library

Macintosh-8:library jeffadler$ ls -l

Macintosh-8:library jeffadler$ 


If I use the ls -l command with the latter, I get the following permissions table:

Macintosh-8:library jeffadler$ cd /Library/Frameworks/R.framework/Versions/3.3/Resources/library

Macintosh-8:library jeffadler$ ls -l

total 0

drwxrwxr-x  12 root  admin  408 Oct 31 07:38 KernSmooth

drwxrwxr-x  16 root  admin  544 Oct 31 07:38 MASS

drwxrwxr-x  23 root  admin  782 Oct 31 07:38 Matrix

drwxrwxr-x  10 root  admin  340 Oct 31 07:38 base

drwxrwxr-x  14 root  admin  476 Oct 31 07:38 boot

drwxrwxr-x  13 root  admin  442 Oct 31 07:38 class

drwxrwxr-x  15 root  admin  510 Oct 31 07:38 cluster

drwxrwxr-x  10 root  admin  340 Oct 31 07:38 codetools

drwxrwxr-x  10 root  admin  340 Oct 31 07:38 compiler

drwxrwxr-x   9 root  admin  306 Oct 31 07:38 datasets

drwxrwxr-x  14 root  admin  476 Oct 31 07:38 foreign

drwxrwxr-x  15 root  admin  510 Oct 31 07:38 grDevices

drwxrwxr-x  11 root  admin  374 Oct 31 07:38 graphics

drwxrwxr-x  12 root  admin  408 Oct 31 07:38 grid

drwxrwxr-x  16 root  admin  544 Oct 31 07:38 lattice

drwxrwxr-x  11 root  admin  374 Oct 31 07:38 methods

drwxrwxr-x  13 root  admin  442 Oct 31 07:38 mgcv

drwxrwxr-x  17 root  admin  578 Oct 31 07:38 nlme

drwxrwxr-x  13 root  admin  442 Oct 31 07:38 nnet

drwxrwxr-x  12 root  admin  408 Oct 31 07:38 parallel

drwxrwxr-x  15 root  admin  510 Oct 31 07:38 rpart

drwxrwxr-x  16 root  admin  544 Oct 31 07:38 spatial

drwxrwxr-x  11 root  admin  374 Oct 31 07:38 splines

drwxrwxr-x  14 root  admin  476 Oct 31 07:38 stats

drwxrwxr-x  10 root  admin  340 Oct 31 07:38 stats4

drwxrwxr-x  16 root  admin  544 Oct 31 07:38 survival

drwxrwxr-x  12 root  admin  408 Oct 31 07:38 tcltk

drwxrwxr-x  11 root  admin  374 Oct 31 07:38 tools

drwxrwxr-x  21 root  admin  714 Oct 31 07:38 translations

drwxrwxr-x  15 root  admin  510 Oct 31 07:38 utils


Using either of these paths allows me to install packages though. I get the same '(package) not writeable message', no matter which i specify in .libPaths()

Alex Perrone

unread,
Dec 12, 2016, 8:34:17 PM12/12/16
to corplin...@googlegroups.com
You need to make it a vector. Try: 

install.packages(pkgs = c("dplyr", "XML", "xml2", "rChoiceDialogs", "stringi", "stringr", "gsubfn", “stringdist"), dependencies=TRUE)


-- 
You received this message because you are subscribed to the Google Groups "CorpLing with R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to corpling-with...@googlegroups.com.
To post to this group, send email to corplin...@googlegroups.com.
Visit this group at https://groups.google.com/group/corpling-with-r.
For more options, visit https://groups.google.com/d/optout.

signature.asc

Jeff Adler

unread,
Dec 13, 2016, 7:06:35 PM12/13/16
to CorpLing with R
That did the trick. Thank you!
To unsubscribe from this group and stop receiving emails from it, send an email to corpling-with-r+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages