Reputation: 103
I am currently trying to install packages on R. On the startup, I get the normal R message with
"Error: object 'getw' not found"
When I use the install.packages
function, I get the same error at the end of the installation, one for each package I tried to install.
However, when I start R with R --no-init-file
I can install packages normally.
I have been fishing around with Rprofile and other initialization settings of R. I have also done clean installs of R, and the message still appears.
Does anyone have an idea about how to remove this error? Also, this machine is running Ubuntu 14.04 Trust Tahr.
Upvotes: 4
Views: 24452
Reputation: 1344
I had the same error. In my case, this was due to a previous partially failed uninstall of the package I was trying to install. Manually removing the partially uninstalled version of the package then allowed intall.packages to succeed.
Full details:
I had run devtools::install_github(...)
which prompted about newer versions of some required packages being available. I opted to install these updated versions in response to the prompt. One of these packages (Rcpp) failed to be installed with an error about being unable to remove the older version of that package (presumably due to the file being in use/locked somehow).
When I tried to install a newer version of Rcpp from install.packages, I got the above error.
After investigating various things, I eventually ran .libPaths()
which output the location my packages are installed. I went to this folder, found the Rcpp subfolder, which was mostly empty except one file (Rcpp.dll) - presumably the file that failed to be deleted before. I deleted this file manually and deleted the Rcpp folder.
I then retried install.packages(...)
which now succeeded.
Upvotes: 0
Reputation: 23798
This sounds like something is wrong with the .Rprofile
file. There can be more than one such file. At the beginning of an R session, R
first searches for such a file in the working directory, then in the home directory.
You may also want to check if the environment variable R_PROFILE_USER
is set (In an R shell, this can be checked with Sys.getenv("R_PROFILE_USER")
). If yes, look at the .Rprofile
file in that directory to see if there is any suspicious entry.
If all fails, make a copy of the .Rprofile
file in your home directory and (if applicable) in your working directory with a different name. Then delete the file and try the installation again. If this succeeds you can afterwards restore the old .Rprofile
file(s) by using the copy/copies that you made before.
Upvotes: 4