0

I have found several other posts here that I thought would guide me through this, but I am running into an issue. For background, where I work we have a small network (5 windows computers) that is not connected to the internet for security reasons. It also has an older version of R which is the only thing our security paranoids will let us install. We'd like to do some text analysis on these machines, and so I was attempting to create my little miniCRAN of text analysis packages.

I began with the miniCRAN package and ran

library(miniCRAN)

mirror <- c(CRAN = "https://packagemanager.rstudio.com/cran/2020-03-02")  #old CRAN compatible with our R version

pkgs <- c("tidytext", "tidyr", "lexicon")    #etc for a long list of packages
pkgList <- pkgDep(pkgs, repos = mirror, type = "source", suggests = FALSE)

dir.create(pth <- file.path(tempdir(), "miniCRAN"))

makeRepo(pkgList, path = pth, repos = mirror, type = c("source", "win.binary"))

After running that I then had a directory called miniCRAN with subdirectories bin and src

I burned the miniCRAN directory to disc and then dropped it on a shared drive on our offline network. At the console in R Studio I then ran

utils::setRepositories(ind = 0, addURLs = c(WORK = "file:Z://<path>/miniCRAN"))

and then I ran

tools::write_PACKAGES("file://z:/<path>/miniCRAN/src/contrib", verbose = TRUE)

I expected with the verbose = TRUE I'd see some feedback but I get nothing...no errors, no warnings, no dialog at all. So then when I try

install.packages("dplyr", dependencies = TRUE)

as a test, I get an error about there being no PACKAGES index. I thought the call to write_PACKAGES() was supposed to create that?

So can someone tell me where I'm going wrong?

EDIT: This question was closed as being a duplicate of this one. However, that was one of the ones I was referring to when I said "I have found several other posts here that I thought would guide me through this, but I am running into an issue." In fact the R commands

utils::setRepositories(ind = 0, addURLs = c(WORK = "file:Z://<path>/miniCRAN"))

and

tools::write_PACKAGES("file://z:/<path>/miniCRAN/src/contrib", verbose = TRUE)

were taken from that very post...but they don't seem to be working in my case.

The src/contib folder that the miniCRAN package creates contains only tar.gz files. I believe there is supposed to be a PACKAGES index file as well, right? But shouldn't write_PACKAGES() create that?

As an aside, the referenced post is almost 13 years old...is it possible something has changed in the meantime?

jerH
  • 1,085
  • 1
  • 12
  • 30

0 Answers0