Open shabbybanks opened 7 years ago
Strange -- I've never seen this error before; the error seems to imply that your R installation does not believe that MASS
is a package of 'Recommended' priority. My understanding is that it has had this priority for quite some time, so I'm surprised this isn't the case on your machine.
What is the output of tools:::.get_standard_package_names()
on your system? For example, I see:
> tools:::.get_standard_package_names()
$base
[1] "base" "tools" "utils" "grDevices" "graphics" "stats"
[7] "datasets" "methods" "grid" "splines" "stats4" "tcltk"
[13] "compiler" "parallel"
$recommended
[1] "MASS" "lattice" "Matrix" "nlme" "survival"
[6] "boot" "cluster" "codetools" "foreign" "KernSmooth"
[11] "rpart" "class" "nnet" "spatial" "mgcv"
with an R 3.4.0 installation on macOS.
It seems more likely that this is an issue with your R installation than packrat per-se -- are you able to successfully install MASS
on your own, with e.g. install.packages("MASS")
?
Note that the set of standard package names is populated on startup with R code of the form:
## we cannot assume that file.path(R.home("share"), "make", "vars.mk")
## is installed, as it is not on Windows
.get_standard_package_names <-
local({
lines <- readLines(file.path(R.home("share"), "make", "vars.mk"))
lines <- grep("^R_PKGS_[[:upper:]]+ *=", lines, value = TRUE)
out <- strsplit(sub("^R_PKGS_[[:upper:]]+ *= *", "", lines), " +")
names(out) <-
tolower(sub("^R_PKGS_([[:upper:]]+) *=.*", "\\1", lines))
eval(substitute(function() {out}, list(out=out)), envir=NULL)
})
which implies that the file located at file.path(R.home("share"), "make", "vars.mk")
might have some unexpected contents. For example, I see:
## Static (i.e., not determined by configure) Make variables to be
## shared *and* grepped from m4/R.m4 and tools/*-recommended.
## There is also 'translations', but that is not Priority: base
## so it can be handled by update.packages() in due course.
R_PKGS_BASE = base tools utils grDevices graphics stats datasets methods grid splines stats4 tcltk compiler parallel
## Those which can be installed initially compiled (not base tools)
R_PKGS_BASE1 = utils grDevices graphics stats datasets methods grid splines stats4 tcltk parallel
## Those with standard R directories (not datasets, methods)
R_PKGS_BASE2 = base tools utils grDevices graphics stats grid splines stats4 tcltk compiler parallel
R_PKGS_RECOMMENDED = MASS lattice Matrix nlme survival boot cluster codetools foreign KernSmooth rpart class nnet spatial mgcv
# there are dependencies in src/library/Recommended/Makefile*
# which this order respects
> tools:::.get_standard_package_names()
$base
[1] "base" "tools" "utils" "grDevices" "graphics" "stats"
[7] "datasets" "methods" "grid" "splines" "stats4" "tcltk"
[13] "compiler" "parallel"
$recommended
character(0)
OK, thanks for the info, I have
> R.home('share')
"/blahblah/anaconda2/envs/r-3.2.2/lib/R/share"
Then in shell
$ cat /blahblah/anaconda2/envs/r-3.2.2/lib/R/share/make/vars.mk
## Static (i.e., not determined by configure) Make variables to be
## shared *and* grepped from m4/R.m4 and tools/*-recommended.
## There is also 'translations', but that is not Priority: base
## so it can be handled by update.packages() in due course.
R_PKGS_BASE = base tools utils grDevices graphics stats datasets methods grid splines stats4 tcltk compiler parallel
## Those which can be installed initially compiled (not base tools)
R_PKGS_BASE1 = utils grDevices graphics stats datasets methods grid splines stats4 tcltk parallel
## Those with standard R directories (not datasets, methods)
R_PKGS_BASE2 = base tools utils grDevices graphics stats grid splines stats4 tcltk compiler parallel
R_PKGS_RECOMMENDED =
# there are dependencies in src/library/Recommended/Makefile*
# which this order respects
Anaconda to the rescue.
My suggestion would be to try patching that file with the recommended packages I noted above, and perhaps reporting this to the Anaconda team.
hahaha, that's a good joke. If I had write access to that file, or much of anything else on this system, I wouldn't be using Anaconda. For now, I think maybe I will just add all of the packages from your R_PKGS_RECOMMENDED
to my ignored.package
field.
For those stumbling on this issue, my hacky fix suggested above is something like follows:
recommended <- strsplit('MASS lattice Matrix nlme survival boot cluster codetools foreign KernSmooth rpart class nnet spatial mgcv','\\s')[[1]]
packrat::init(options = list(ignored.packages = recommended))
OK, that hacky fix will not fly, I think. After an apparently successful init
, I then run status
and get some nonsense:
> packrat::status()
The following packages are used in your code, tracked by packrat, but no longer present in your library:
from to
MASS 7.3-45 NA
Matrix 1.2-2 NA
boot 1.3-17 NA
codetools 0.2-14 NA
lattice 0.20-33 NA
mgcv 1.8-9 NA
nlme 3.1-122 NA
nnet 7.3-11 NA
survival 2.38-3 NA
Use packrat::restore() to restore these libraries.
If you then run restore
, nothing changes:
> packrat::restore()
Already up to date.
Try to run R with sudo. This problem could be related to administrative rights.
If I had sudo
rights I sure wouldn't be using Anaconda or R3.2.2.
Hi, was someone able to fix this issue?
I got the same problem when I try to deploy my shiny-app. I'm running rstudio as admin and still get following errors:
_The application failed to start (exited with code 1).
Error in value[3L] : there is no package called ‘shinythemes’
Ruft auf: local ... tryCatch -> tryCatchList -> tryCatchOne ->
_Deployment completed: https://juliehofer.shinyapps.io/SOLA_Nachhaltigkeit/ Warnmeldung: In fileDependencies.R(file) : Failed to parse C:/Users/julie/AppData/Local/Temp/Rtmpst12h3/file36603669423e/app.R ; dependencies in this file will not be discovered._
I checked for missing packages with packrat and restored them, the deploy is still not working :(
I am getting the error
Invalid Priority field
for theMASS
package when callingpackrat::init()
. My MWE is as follows:mkdir -p mytmpdir
cd mytmpdir
echo 'library(car)' >> script.R
R --no-save
require(packrat) && packrat::init()
I get the following:
It seems that my
installed.packages()
only knows about packages with prioritybase
orNA
. This might be due to using R 3.2.2. Note that "just upgrade R" is not a feasible solution for me.My session info: