hoogltb.blogg.se

Run rmarkdown from command line
Run rmarkdown from command line









run rmarkdown from command line
  1. Run rmarkdown from command line pdf#
  2. Run rmarkdown from command line code#

I used the code '''mv Modularized_Dashboard.pdf /opt/model/p6/p6_gb604/out/dashboards/Modularized_Dashboard.pdf'' and got the error '''mv: cannot create regular file '/opt/model/p6/p6_gb604/out/dashboards/Modularized_Dashboard.pdf': Permission denied```.

Run rmarkdown from command line pdf#

If you agree, I'll try to troubleshoot some of the issues you've been having with generating these dashboards from the Linux command line so that that option is up and running.įor the new, modularized dashboard, I used the code Rscript -e "rmarkdown::render('~/cbp6/code/Modularized_Dashboard.Rmd', params = list(riv.seg = 'JU3_7400_7510', dat.source1 = 'vahydro', dat.source2 = 'vahydro', start.date = '', end.date = '', github_link = '~', site = '', site.or.server = 'server', run.id1 = '120', run.id2 = '121', gage_number = '02018000', mod.phase1 = 'p6/p6_gb604', mod.scenario1 = 'CFBASE30Y20180615', mod.phase2 = 'p6/p6_gb604', mod.scenario2 = 'CBASE1808L55CY55R45P50R45P50Y'))" to create the file "Modularized_Dashboard.pdf" within my "~/cbp6/code" directory - the issue I'm running into now is that I am unable to view this file.įirst, I tried moving the generated pdf to the /out/dashboards directory so that I could view them from. This function is broken at the moment (and also useless for the type of analysis we're doing now) - I could fix and expand upon this function so that it is usable for the type of analysis we are doing now (VA Hydro model run vs VA Hydro model run), but your method of generating the scripts seems to be far more useful for our current analysis - the only upside of the automated_dashboard function was the ability to generate all the dashboards at once, but that doesn't seem like a capability we need for our current analysis which is more focused on specific river segments. So, in short, my workaround was to render a pdf of the Rmarkdown within a R function which I would run from R on the deq2 server - this is why those parameters were being passed into the Rmarkdown file via the params variable.

run rmarkdown from command line

cbp model scenario 2 comparison back when that was the only type of comparison we were doing). This script contains a function, automated_dashboard, which reads in a list of all river segments and then generates a pdf for each of these river segments from "Working_Dashboard_2019.Rmd" (a now-defunct markdown file which generated a cbp model scenario 1 vs.

run rmarkdown from command line

Instead, the workaround I developed when we were generating dashboards en masse for previous analysis is shown in the R file Automated_Dashboard_Creator_2019.R.

run rmarkdown from command line

Try it out and check out the resulting pdf. But I did create a functioning example that creates a very simple PDF using command line argument input. So, this part works! I did not succeed in running the whole script, but that was expected since there are a host of things to do there.











Run rmarkdown from command line