... Hello everyone,
I am developing a Shiny app for risk analysis that calculates a risk score based on multiple user inputs. I want to provide my users with the ability to download detailed reports in multiple formats: PDF, Word (.docx), CSV, and Excel (.xlsx).
My goals are:
- Use R Markdown to generate the PDF and Word reports dynamically, including user inputs and the calculated score results.
- Include explanatory bar charts in the reports that break down the score by its contributing factors, so users can understand how each input influences the final score.
- Export the raw data (inputs and results) as CSV and Excel files.
- Keep the app structure intact, especially the UI tabs and user access levels (free and premium).
- Ensure that all downloads work seamlessly without affecting the current app functionality.
So far, I have been able to generate basic reports, but I am struggling with:
- How to include the dynamically generated score charts inside R Markdown reports.
- How to set up multiple download handlers for different formats without code duplication.
- How to organize parameters and reactive inputs efficiently to pass to the Rmd templates.
- Best practices for combining graphical outputs with tabular data in the Word and PDF reports.
I would really appreciate examples or guidance on:
- Creating R Markdown templates that accept parameters from Shiny.
- Embedding Plotly or ggplot2 graphs inside these reports.
- Generating CSV and Excel downloads alongside the Rmd-based reports.
- Any tips to keep the downloads performant and maintainable.