The R Studio version is 1.2.5042, the R version is 3.6.2 ("Dark and Stormy Night") on both Mac and Windows, but while the code ran in Mac, it did not in Windows (Error: LaTeX failed to compile). Has anyone else run into this issue? If so, how did you resolve this?
What is the code you are trying to run? Can you try to run the smallest possible subset that leads to that error?
For me this message could mean either that you're trying to install a LaTeX distribution but compilation fails, or that you're trying to compile LaTeX code (e.g. knitting an Rmarkdown document to pdf). The second possibility feels more likely.
So in that case you will want to ensure you have a LaTeX distribution available in your system, potentially installing tinytex, and make sure you can compile simple documents.