[BUG] consulting about using the golem package to develop a Shiny application (embedding Rmarkdown) and packaging it into a package, but encountering issues with calling Rmarkdown files. #1181
Labels
bug
Something isn't working
Describe the bug
I am currently researching the development of a Shiny application (embedding Rmarkdown files) using the golem package. I have encountered a problem where after developing the Shiny application with the golem package and packaging it using devtools, upon reinstalling the package, I am unable to call my embedded Rmarkdown file. The error message "Error: The file 'R\R_Month_Report.Rmd' does not exist." is displayed. I would like to inquire how to resolve this issue. I have been unable to find a solution.
To Reproduce
The code for calling the Rmarkdown file in Shiny server is as follows:
My Rmarkdown file is located in the R folder of the RProj. In the Rproj environment, everything works fine when opening the Shiny app using run_app().
Then, after packaging with devtools using the code:
devtools::build(path = "E:\\myShinyApp\\autoreport")
The package name is set as autoreport. After installing and loading the autoreport package, when I reopen an R file in a non-Rproj environment and run autoreport::run_app(), the Shiny interface opens successfully. However, there is an unexpected issue where the functionality of the rmarkdown::render call is not working as expected, and it shows an error: "Error: The file 'R\R_Month_Report.Rmd' does not exist."
Upon checking the compiled R package, I found only three files in the R folder, two of which are rdb and rdx files.
Subsequently, I tried adding the following code in the 02_dev.R file with the explanation "Add internal datasets If you have data in your package":
However, none of these attempts were successful, and the error "Error: The file 'R\R_Month_Report.Rmd' does not exist." persists.
I have been trying to find a solution for two days without success. I would like to seek advice from yours on how to resolve this issue in this scenario.
The text was updated successfully, but these errors were encountered: