Vanuatu-National-Statistics-Office / vnso-trade-dashboard

GNU General Public License v3.0
0 stars 0 forks source link

Dashboard error #3

Open trara538 opened 2 years ago

trara538 commented 2 years ago

Joe, I recently have this error trying to run my Dashboard application. I cannot find what is wrong with the script. Would you be available to assist me please?

" processing file: Dashboard_New.Rmd

Quitting from lines 12-39 (Dashboard_New.Rmd) Warning: Error in : RStudio not running 145: stop 144: verifyAvailable 143: callFun 142: getDocumentContext 141: rstudioapi::getSourceEditorContext 138: eval 137: eval 132: evaluate_call 131: evaluate::evaluate 130: evaluate 128: eng_r 127: block_exec 126: call_block 125: process_group.block 122: process_file 121: knitr::knit 120: 115: 99: doc 98: renderUI 97: func 84: renderFunc 83: output$reactivedoc 3: 1: rmarkdown::run

"

JosephCrispell commented 2 years ago

HI @trara538,

This is caused by this line: https://github.com/Vanuatu-National-Statistics-Office/vnso-trade-dashboard/blob/9b03f9f41e3de2755181e464f3e17c0633b6df6f/R/Dashboard_New.Rmd#L32

Which is using the RStudio API to determine where the current script is and will break when the script is not being run from within RStudio.

Rmarkdown files automatically set the working directory to their current location when running so you can remove this code and change any file paths to be relative to the Dashboard_New.Rmd scripts location.