I need to use RStudio on a corporate Virtual Machine (Windows 10). Because of the firewall, I cannot download packages and install them as I do on my local machine. I have tried many instructions out there, but none of them helped. I guess I am missing something. I appreciate it if someone can explain all the steps in detail that I can follow and hopefully resolve the issue.
I just installed R 4.2.0 and RStudio version info:
RStudio 2022.02.3+492 "Prairie Trillium" Release (1db809b8323ba0a87c148d16eb84efe39a8e7785, 2022-05-20) for Windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36
Assume basic knowledge out of the R/RStudio environment, please.
Your topic title says your connection is behind a proxy server but then you mention a firewall, they are not the same. If you actually mean a proxy server, you know your credentials and CRAN URLs are not explicitly blocked by your company, then you can follow this support article to configure R to work with your company's proxy server.
If your connection is behind a firewall, then only a network administrator with sufficient privileges can white list CRAN URLs on the firewall income rules.
So, from that link you shared, I guess I should make some changes in R first (for that download.file function) and then make some changes in RStudio, right?
I tried to understand what to do with download.file but I got lost completely.
Nope, you are just supposed to define this environment variables (holding your credentials) on a .Renviron file, since it seems you are using RStudio desktop, that file should be located at your HOME directory (you can open it with this command file.edit('~/.Renviron')) and if it doesn't exist you have to create it, it is just a text file.