Installing packages for 2nd edition of Quantitative Corpus Linguistics with R

122 views
Skip to first unread message

David Elliott

unread,
Jul 3, 2017, 10:20:29 AM7/3/17
to CorpLing with R
Hi,

I am starting to work through the second edition of Stefan's Quantitative Corpus Linguistics in R, and I received the error and warning messages below when trying to install the packages used in the text.  Any suggestions would be appreciated.

Thanks,

David

 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
Error in available[p1, dependencies, drop = FALSE] :
  incorrect number of dimensions
In addition: Warning message:
package ‘dplyr’ is not available (for R version 3.4.0)

Stefan Th. Gries

unread,
Jul 3, 2017, 12:28:16 PM7/3/17
to CorpLing with R
Are you running R as sudo/administrator?

David Elliott

unread,
Jul 3, 2017, 12:30:50 PM7/3/17
to corplin...@googlegroups.com
Yes.

On Jul 3, 2017 11:28 AM, "Stefan Th. Gries" <stg...@gmail.com> wrote:
Are you running R as sudo/administrator?

--
You received this message because you are subscribed to a topic in the Google Groups "CorpLing with R" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/corpling-with-r/qoR_r3P3lak/unsubscribe.
To unsubscribe from this group and all its topics, send an email to corpling-with-r+unsubscribe@googlegroups.com.
To post to this group, send email to corpling-with-r@googlegroups.com.
Visit this group at https://groups.google.com/group/corpling-with-r.
For more options, visit https://groups.google.com/d/optout.

Stefan Th. Gries

unread,
Jul 3, 2017, 12:35:15 PM7/3/17
to CorpLing with R
Hm, strange then. I would try to make sure you install from an
up-to-date mirror (MRO's one, for instance, is not as up-to-date as
others), then install one package at a time to see where things go
wrong more precisely. Also, check where R tries to install stuff and
maybe set the argument lib (of install.packages) accordingly; try

.libPaths()

to see what your options are. I am running MRO 3.4.0 on one computer
now and dplyr installed fine.

Alex Perrone

unread,
Jul 4, 2017, 10:14:26 AM7/4/17
to corplin...@googlegroups.com
The issue is that the package names are just listed, as opposed to being wrapped in a character vector. Try this:

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

Other comments: 

- this came up on the list before, maybe the book suggested code like this? 
- the error message tips this off: it says “XML” is not writeable, and if you look at ?install.packages, the second argument is the lib, so it thinks “XML” is the lib, and reports it is not writable which is kinda true but probably more true that the folder doesn’t exist. 


--
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.

David Elliott

unread,
Jul 4, 2017, 10:32:28 AM7/4/17
to corplin...@googlegroups.com
That makes sense, Alex, and it worked.  Thanks a lot, and thanks to you, Stefan.

Have a happy Fourth,

David

On Tue, Jul 4, 2017 at 9:14 AM, Alex Perrone <boet...@gmail.com> wrote:
The issue is that the package names are just listed, as opposed to being wrapped in a character vector. Try this:

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

Other comments: 

- this came up on the list before, maybe the book suggested code like this? 
- the error message tips this off: it says “XML” is not writeable, and if you look at ?install.packages, the second argument is the lib, so it thinks “XML” is the lib, and reports it is not writable which is kinda true but probably more true that the folder doesn’t exist. 


On Jul 3, 2017, at 10:20 AM, David Elliott <david.e...@gmail.com> wrote:

Hi,

I am starting to work through the second edition of Stefan's Quantitative Corpus Linguistics in R, and I received the error and warning messages below when trying to install the packages used in the text.  Any suggestions would be appreciated.

Thanks,

David

 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
Error in available[p1, dependencies, drop = FALSE] :
  incorrect number of dimensions
In addition: Warning message:
package ‘dplyr’ is not available (for R version 3.4.0)


--
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-r+unsubscribe@googlegroups.com.
To post to this group, send email to corpling-with-r@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "CorpLing with R" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/corpling-with-r/qoR_r3P3lak/unsubscribe.
To unsubscribe from this group and all its topics, send an email to corpling-with-r+unsubscribe@googlegroups.com.
To post to this group, send email to corpling-with-r@googlegroups.com.

Stefan Th. Gries

unread,
Jul 4, 2017, 12:08:11 PM7/4/17
to CorpLing with R
Ah, of course, I didn't even notice, thanks Alex, I should have seen that, too!
Reply all
Reply to author
Forward
0 new messages