I have solved the problem since my original post - although I am not quite sure which one thing eventually fixed my issues
A couple of items that were useful:
I thought I had uninstalled everything prior to making a new install attempt, but I had overlooked the .Rproflie and the .Renviron files in my default directory. I had to get rid of those.
I had to go find a machine without issues to know what the output of Sys.getenv("PATH") should look like.
For reference, R is installed on my system in D:\Program Files\R\R-4.0.1\bin, so I expect to see
"D:\Program Files\R\R-4.0.1\bin\x64" somewhere in the text returned by Sys.getenv("PATH").
If you see the wrong folder referenced, or don't see your folder referenced at all, then try the steps 1-4 from http://yizhexu.com/2017/02/r-path/:
- Verify R is installed in the following path: C:\Program Files\R\R-3.3.2\bin\x86
- Open the start menu and type in “View advanced system settings”, click on “Environment variables”
- Under “System variables”, select Path and click on edit.
- Click “New”, and add the folder address for R to there (C:\Program Files\R\R-3.3.2\bin\x86)
- Open windows power shell and type in Rterm or R.exe to launch R command line tool
My path variable was defined as "D:\Program Files\R\R-4.0.1\bin", instead of "C:\Program Files\R\R-3.3.2\bin\x86".
Note: if there's an incorrect environment variable, used the advanced system settings to fix it or delete it.
My steps after that:
I installed R 4.0.1. No problems.
I installed RStudio 1.3.959. No problems.
Because RStudio said I needed Rtools, I also installed Rtools40.
I did the checks recommended in jtleek's slide show: Verify Rtools installation at
http://jtleek.com/modules/01_DataScientistToolbox/02_10_rtools/#6
install.packages("devtools")
library(devtools)
find_rtools()
This should return TRUE in the console if your Rtools installation worked properly
Then I did the last few instructions from the Rtools installation page:
In R, entered:
writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron")
Restarted R, then entered:
Sys.which("make")
make
"D:\\rtools40\\usr\\bin\\make.exe"
I also tried the test of
install.packages("jsonlite", type = "source")
..which was successful.
I hope this helps!