0
votes

I am using RStudio version Version 1.1.447. I have tried to installed the digest package because it is required for the package leaflet. I used the statement:

install.packages('digest', dep=TRUE)

and it seems that the package knitr is stalled successfully. But at the end of the installation, it gives me an error that the knitr was not found. I can't figure out what is causing the problem.

I found a previous question similar to mine but it doesn't have a solution: knitr question

I would appreciate very much any help.

package ‘mime’ successfully unpacked and MD5 sums checked
package ‘tinytex’ successfully unpacked and MD5 sums checked
package ‘knitr’ successfully unpacked and MD5 sums checked
package ‘rmarkdown’ successfully unpacked and MD5 sums checked
package ‘digest’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in C:\Users\MCetrar\AppData\Local\Temp\RtmpmWreO3\downloaded_packages

Error: invalid version specification ‘NA’
In addition: Warning message:
In utils:::packageDescription(packageName, fields = "Version") :
  no package 'knitr' was found
1
There are all kinds of potential reasons for this. Since it seems that you are on a Windows PC, my first suggestion would be to open RStudio as administrator to see if it's a permission problem. It would also help if you could post the output from sessionInfo() and .libPaths(). Also try installing knitr on its own first install.packages("knitr")JBGruber

1 Answers

0
votes

I think the issue is that RStudio loads rmarkdown as well as knitr on start. However, since some packages are laoded, R does not seem able to update them. I think you can solve your problem doing the following:

  1. Locate your R installation. Usually this should sit in C:/Program Files/R/R-3.5.1/bin/R.exe
  2. Start R from this exe instaed of the RStudio GUI
  3. Use install.packages('digest',dep=TRUE) in the command line window that appears

If this doesn't work, you can try using R.exe as administrator (right-click "run as administrator").