[R] maximum number of dlls issue

Prof J C Nash (U30A) nashjc at uottawa.ca
Wed Dec 10 22:03:01 CET 2014

I'm attempting to run the following script to allow me to
bring a "new" computer to a state where it can run a set of scripts
that is running on another.

# listcheckinstall.R
# get a list of R packages from a file,
# check if installed,
# install those not installed
# then update all packages
# Run as superuser
listname <- readline("file of packages=")
np <- length(biglist)
# instlist <- installed.packages()  # this is alternative method
for (i in 1:np) {
## if (biglist[i] %in% instlist) {  # this is alternative method
   if (require(biglist[i], character.only=TRUE) ) {
      cat(biglist[i], "is installed\n")
      biglist[i] <- NA
   } else {
      cat("need to install ",biglist[i],"\n")
   tmp <- readline("next")
plist <- biglist(which(! is.na(biglist)))

About 2/3 of the way through, I get a msg that the maximum number of
dlls has been loaded and then some consequent errors.

I've been looking at library.dynam.unload and .dynLibs as a way to
possibly unload things require() has got into the workspace. So far no
success. I suggest offline contact and I'll post solution or relevant
discussion when things are worked out.

The installed.packages() list approach works OK, so this is not
critical. I was thinking installed.packages() would be slow, but in fact
the call is only done once, and it runs faster than the "require"
approach. However, I would like to understand what is going on with the
DLLs and how to sort them out if needed.

> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)

 [1] LC_CTYPE=en_CA.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_CA.UTF-8        LC_COLLATE=en_CA.UTF-8
 [7] LC_PAPER=en_CA.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

OS = Linux Mint Maya (Ubuntu 12.04 derivative) 64 bit.


More information about the R-help mailing list