Launching R with command line arguments

Is it possible to launch R within RStudio using command line arguments to the R executable?

Here is a use case. As of R 4.4.0, it is possible to pass --max-connections=512 (or some other value) to change from the default limit (128). How can this limit be increased for use within RStudio?

Hoping an additional post might attract some attention.

While I'm at it, I'll ask how RStudio "locates an R installation on the system".

One of the things I tried was to create a bash script that executes R with --max-connections=512. Then I set the RSTUDIO_WHICH_R environment variable to point there. If I run my script from the command line, R launches with the correction number of available connections. But if I open RStudio, I get an error message saying it cannot locate an R installation on the system.

How can I tell RStudio that my script is an R installation (and to use all the files that are associated with the usual R install)?

Hi, I'm opening a related topic in case it helps — I'll add the link later.

My understanding is that RSTUDIO_WHICH_R is only relevant when you're working on a Mac system.

I work on Windows. I just recompile R from source, thereby creating a version of R that has max connections set above the default.

I agree that RStudio should add a parameter that's functionally equivalent to the --max-connections option.

Follow up can be done in this issue for when this will be possible