Working with RStudio on a server within the company's network that has no connection to the internet (basically all ports are closed) I was installing packages by source so far. Until I realized that install.packages actually works. I was puzzled. How does install.packages achive this?
The documentation says install.packages uses download.file to download the package zip.
For example, not surprisingly, both calls below return error messages like cannot open connection / HTTP status was '403 Forbidden
I'd like to know the parameters for the connection so that I can download data for other purposes my self with download.file. I failed to find out myself with debugonce(install.packages).
My interest is in the exact connection parameters these functions are using which I possibly should also give to download.file to succesfully connect outside our company network. How could I trace down this?
So you do have and internet connection but it is severely restricted, I would guess the address is simply white listed by your IT department on a firewall or proxy server and there is no loop hole in the R side of things that you can exploit.
Yes, I assume the same. But, why do I have no access interactively running download.file while intsall.packages apparently gets access? I am calling the same URL (CRAN) from the same process (RStudio). A whitelist should not exclude one but not the other here. The connection details in intsall.packages must carry information to get access, like porxy IP and port and how it is forwarded to download.file. How can we access this information, e.g. make install.packeges verbose or debug it? I would like to simulate interactively what intsall.packeges is doing, for example with download.file.
Thing is though, if your server is locked down by your firms security policies, they may not see kindly to your even attempting to sidestep it ... I could imagine scenarious where this couldput you in danger.
I know this is an R forum and not career advice, but if I was in your shoes I would talk to a sysadmin for the server. before proceeding in this direction.