How it's possible to deploy RMarkdown document on Posit without rendering (calculations) it?

I have a data and modelling pipeline that takes me 5h of local calculations. If I deploy it on Posit it's taking me 5h (rendering locally during deployment) + 5h (rendering on Posit) = 10h of calculations.

Does anyone know how to deploy RMarkdown doc without local and posit rendering and start doing it by schedule only.

Any ideas are welcome!

Have you tried ```{r eval =FALSE } in the headers?

If I include this option the code will be not be running as I read doc.

My issue that I do not want to run code only on the deployment stage.
When RMarkdown notebook is ON the Posit - it will be setup to running on the daily base.

And yes it can be rendering on Posit (not on local mac)

Hi,
I previously encountered a similar issue and resolved it by deploying the main script as part of the bundle files. The primary file in this bundle is a script named 'deployment' that triggers your R script to execute only after a specific due date. Initially, when the bundle is deployed, the 'deployment' script runs, but it does not execute the R script because the due date has not yet been reached. You can schedule the 'deployment' script to run post-due date using 'connect', and this should ensure smooth operation.

Below is an example:
The main script that i want to delay the execution is names "5.FBB_D1_UNV_Scoring.Rmd", i will put in resource files. and i will deploy instead another script called "deployment.Rmd" that contains the below script


title: "Deployment"
output: html_notebook
rmd_output_metadata:
rsc_output_files:
- 5.FBB_D1_UNV_Scoring.nb.html

resource_files:

  • 5.FBB_D1_UNV_Scoring.Rmd
  • NULLVAR.Rds
  • trained_rec_glmnet.Rds
  • fbb_d1_unv_modelLL_glmnet_xgboost.Rds
  • renv.lock
  • config.yml

systemtime <- lubridate::ymd_hm(strtrim(Sys.time(),16))
first_scoring_time <- lubridate::ymd_hm("2024-03-10 13:00")
if(systemtime < first_scoring_time){
print("scoring time not reached")
} else {
   rmarkdown::render('./5.FBB_D1_UNV_Scoring.Rmd') # This is my main script to be executed after due date
 }

View Deployment Scoring Output Document # The html file will be directly accessible from the deployment script