Trouble Installing Rmarkdown Windows

I use a Mac myself, so I don't personally have this problem. However, I teach intro Stat and essentially all of my students with windows computer have the following experience.

On the first attempt at creating a markdown document, there is a popup that offers to install some mandatory packages.
This almost always fails. I've never had a report of success. This is true of both windows 8 and windows 10.

I've discovered the workaround, which is to enter the following command in the console.

install.packages("rmarkdown").

This almost works perfectly, but there is usually a required package, recently formatR and/or rlang , that is not installed. This prompts a return to the popup dialogue, which does work in this case.

I'm not desperate about this since I have the workaround, but it does leave my students with diminished faith in R.

I've just started up 59 UG on R this semester and this or some variant of it causes issues on many windows machines.

The other error is failing to transfer the installed package from temp directory to library. When that happens even the "manual install " fix doesn't work.

In every case I was able to get around the problem by temporarily turning off the real time protection from anti-virus packages. Install worked cleanly and then re-enable AV package.

Yes, I've also seen this problem with moving packages from the temp directory to the library, but not recently. The problem package was usually Rcpp. In addition to Norton or whatever antivirus. I've had to worry about windows defender. Sometimes I had to move the package manually.

1 Like

For what it's worth, the development versions of R will retry file operations on Windows to help work around these sorts of issues. You can see a commit from R-Core member Tomas Kalibera here:

Hopefully this implies the situation will be improved with R 3.5.0 and beyond!

1 Like