Error in file(con, "r"); editing makevars.win

Thank you for the quick response. After trying what it says in the linked post, I am getting:

Error in compileCode(f, code, language = language, verbose = verbose) :
g++.exe: error: Files/R/R-4.0.2/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp: No such file or directorymake: *** [C:/PROGRA~1/R/R-40~1.2/etc/x64/Makeconf:229: file6a3460c4938.o] Error 1
In addition: Warning message:
In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
‘C:/rtools40/usr/mingw_/bin/g++’ not found
Error in sink(type = “output”) : invalid connection

When I tried to search for this new error in the forum, I went to this post, where it recommends resolving issues with RStan on Windows by editing .R/Makevars.win, which leads me back to my original question - I am not sure how to do this.

Thanks for your help!