r-lib / callr

Call R from R
https://callr.r-lib.org/
Other
297 stars 36 forks source link

Setting different R_HOME for the callr subprocess #282

Open maksymiuks opened 4 months ago

maksymiuks commented 4 months ago

Hi

I'm trying to spin a new callr process that is different from the default R_HOME value. In general, I want my subprocess to operate on the different base library (alternative location for .Library), and for that, it has to start with a different R_HOME value. Unfortunately, whenever I try to set R_HOME for the caller subprocess, it does not work. It does not matter for my use case whether I use default or alternative R executable, so I tried using the arch parameter, but seemingly still the default R_HOME was used. Is there a way to achieve such replacement in the callr?

gaborcsardi commented 4 months ago

Can you try to show an example?