Consulting about using the golem package to develop a Shiny application (embedding Rmarkdown)

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 'RR_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:

output$rendered_markdown <- renderText({ rmarkdown::render(input = "RR_Month_Report.Rmd", output_file = paste0(path_excel_all, "R_Month_Report", Sys.Date(),".html")) })

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 'RR_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":

usethis::use_data_raw(name = "R\R_Month_Report.Rmd", open = FALSE) usethis::use_data_raw(name = "R\R_Month_report_word.Rmd", open = FALSE) usethis::use_data_raw(name = "R\template_word.docx", open = FALSE)

However, none of these attempts were successful, and the error "Error: The file 'RR_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.

New contributor

YY LIU is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Files in R/ are not available after installation. You should put any files you need in inst/ instead and access them with system.file("R_Month_Report.Rmd", package = "<your package>") (inst is the root).

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật