Cannot resolve the "cannot allocate vector of size … " error

I can’t see what .Renviron contains, but I assume it is fine.

Remove Sys.setenv(BINPREF = “C:/Rtools/mingw_$(WIN)/bin/”) from your .Rprofile.

Also… move or rename Documents/.R/Makevars.win.