You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow rstudioapi to work inside child R sessions #4490
Currently, rstudioapi does not work inside child R sessions -- jobs, R markdown renders, etc. This is because all of the functions it calls exist only in the parent R session.
It would be very useful to be able to invoke rstudioapi functions inside child R sessions. For example, we could use them:
for knitr to report knit progress from its child R session
for RStudio jobs to orchestrate actions in the parent R session (e.g. open a tab with results when complete)
for learnr and other Shiny-based apps to drive the IDE without blocking the R console
and probably lots of other scenarios
This could take the form of exposing the whole API generically with some kind of mechanism that marshals function arguments and return values, or creating a subset of the API specifically intended for child processes with different signatures/semantics.
This has now been implemented -- rstudioapi functions, when executed within R child processes launched by RStudio, should now work and communicate back through the main RStudio session.
No, unfortunately this isn't yet possible -- this is only for child processes normally launched by RStudio, not arbitrary child processes from R or R packages.
Activity
garrettgman commentedon Jun 4, 2019
This feature request is an important component of the plan we came up with on 5/22/19 to make an IDE friendly tutorial format.
kevinushey commentedon Sep 25, 2019
This has now been implemented --
rstudioapifunctions, when executed within R child processes launched by RStudio, should now work and communicate back through the main RStudio session.schloerke commentedon Sep 25, 2019
Wow! Thank you!
tmcduff commentedon Jan 21, 2020
Version 1.3.749
AshesITR commentedon Apr 30, 2020
Is there any way to use this within a
future?Apparently, those processes aren't spawned as child processes.
Setting up a different future plan which does spawn child processes would be fine with me as well.
(running on windows)
Created on 2020-04-30 by the reprex package (v0.3.0)
kevinushey commentedon Apr 30, 2020
No, unfortunately this isn't yet possible -- this is only for child processes normally launched by RStudio, not arbitrary child processes from R or R packages.