RMarkdown code returns fatal `error:unexpected:bad allocation` and aborts session

Following suggestions from I need help to resolve Fata error: unexpected exception: string too long - RStudio IDE - Posit Community made by HanOostdijk, here is my RProfile info.

Running file.edit(file.path("~", ".Rprofile")) # edit .Rprofile in HOME returns:

Sys.setenv(PATH = paste("C:/rtools42/usr/bin",
                        "C:/rtools42/mingw64/bin", 
                        "C:/rtools42/x86_64-w64-mingw32/include",
                        Sys.getenv("PATH"), sep = ";"))

Running file.edit(".Rprofile") # edit project specific .Rprofile returns an empty script for the current RProject.