Run rmarkdown chunk as a background job?

Hello,

I would like to run a sql chunk in the background of an R notebook. The chunk makes a table and takes ~20 minutes. Like with the jobs tab, I wonder if there is a way to run an rmarkdown chunk as a 'job'?

```{sql, connection = conn}

    CREATE TABLE db.dans_data AS
SELECT * FROM gov.data 
LIMIT 100

(By the way, I'm not really looking for a 'hack' to do this. I'd like to keep the whole analysis together if possible, and if there's some parameter I can add to put it in the background, great! If not, no big deal)

Any ideas?

I don't think there is currently a way to do that. This would be a feature request for the IDE and/or maybe some adjusments in Rmarkdown.

Thanks a lot for your quick reply!

If you only want to run this chunk occasionally, it might be worth looking at the options for caching it. You can either use the cache system built into rmarkdown chunk arguments, or an a solution like the drake package. I prefer the drake package.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.