r-lib / callr

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

Set device for printing #252

Closed king-of-poppk closed 5 months ago

king-of-poppk commented 1 year ago

Is it possible to specify a device for print statements inside the evaluated function? For instance, so that we can print plots simply with print(plot).

gaborcsardi commented 10 months ago

Sure, you can open a device in the function that you are running in the subprocess.

king-of-poppk commented 10 months ago

What about printing to a device of the parent process?

gaborcsardi commented 10 months ago

R cannot use a graphics device from another process.