I found the answer here
You have to edit the path in the following line. Beats me why Rtools just doesn’t install in this directory.
cat(‘Sys.setenv(BINPREF = “C:/Rtools/mingw_$(WIN)/bin/”)’,
file = file.path(Sys.getenv(“HOME”), “.Rprofile”),
sep = “\n”, append = TRUE)