There is an alternative to using the file system:
RStudio Connect lets R Markdown documents specify "output files", or secondary resources produced by a document render.
https://docs.rstudio.com/connect/user/r-markdown.html#r-markdown-output-files
You can load those output files over HTTP. If your report is available at https://rsc.company.com/myreport/ with a data file data.csv, you can obtain that file with https://rsc.company.com/myreport/data.csv
This CSV file is subject to the same authorization as your report. Your Shiny application can perform an authenticated HTTP request using a Connect API key.
The cookbook in the RStudio Connect user guide contains examples using httr to perform authenticated HTTP requests.
https://docs.rstudio.com/connect/user/cookbook.html#cookbook-configuring-your-scripts
The last piece is updating that data in the Shiny app after each Rmd render. Use shiny::reactivePoll to detect when the data.csv changes. The Last-Modified information of the HTTP request indicates if the data file has been updated. If the feather file is large, I recommend performing a HEAD request for the Last-Modified data. Once you know the file has changed, issue a GET request.
This approach means you can develop your Shiny application using the Connect-generated Rmd output without relying on the local file system. Connect also maintains each version of your data.csv alongside the historical rendered output.
In summary:
- Have your Rmd declare and produce some number of output files.
- Load those output files over HTTP from your Shiny application.