1

I just started using R and downloaded ggplot2

install.packages("ggplot2")

I get the following warning:

Warning in install.packages:
unable to move temporary installation '\\CHI-FIlE-01\UserFolders$\naresh.kavuri\Documents\R\win-library\3.2\file27ac2d3b613c\ggplot' to '\\CHI-FILE-01\UserFolders$\naresh.kavuri\Documents\R\win-library\3.2\ggplot2'

This warning is followed up with this error:

Error: invalid version specification 'NA'
In addition: warning message:
In utils:::packageDescription(packageName, fields = "Version") :
no package 'knitr' was found

As anyone come across this problem before? Did I do something wrong in the setup?

Naresh
  • 11
  • 2
  • 1
    Do you have any antivirus running? –  Aug 24 '15 at 04:21
  • I've come across this recently. For me, it had to do with a Windows network drive that was not sync-ing properly. Usually just trying a couple of times will make it work. If you suspect this is the case and it just won't work, I finally solved it by manually removing the 'ggplot' folder from the library directory, recreating it through the command line, re-syncing the folder manually, and then running install.packages again. If it's not a network drive issue, then consider other possibilities like antivirus, multiple incidences of R etc. – thelatemail Aug 24 '15 at 05:04
  • Useful information [here](http://stackoverflow.com/questions/5700505/windows-7-update-packages-problem-unable-to-move-temporary-installation) and [here](http://stackoverflow.com/questions/5059692/unable-to-update-r-packages-in-default-library-on-windows-7). –  Aug 24 '15 at 05:09

1 Answers1

0

If you have multiple versions of R running, and you try to update or reinstall a package in one version of R while it is loaded in another, then the old version of the package doesn't get completely removed.

Try closing down all instances of R, manually deleting the folder containing the package, then opening a single version of R and reinstalling.


As Pascal commented, antivirus file scans can also interfere with the installation process. Sometimes downloading the package zip/tar.gz file then installing from disk can circumvent the issue.

Richie Cotton
  • 118,240
  • 47
  • 247
  • 360