CLiREN-LMS
Data Analysis in R

Exporting Summary Outputs

Exporting Summary Outputs

30-45 minutes Applied Step 5 of 9
Accordion

Exporting Summary Outputs

5 / 9
Accordion

Exporting Summary Outputs

Part 1
After creating summaries, the data manager often needs to export outputs for review. Outputs may be CSV files, Excel workbooks, HTML reports, Word documents, PDFs, or dashboard inputs. This chapter focuses on simple CSV and Excel-style outputs because they are easy to inspect and share within controlled workflows. CSV export is straightforward: CSV files are simple and transparent. They are suitable for data exchange, but they do not preserve formatting such as bold headers or merged cells. For many data management workflows, that is a strength. The output is easy to read back into R and compare across weeks.
Part 2
If the team needs an Excel workbook with multiple sheets, a package such as `writexl` can be used: This creates one workbook with multiple sheets. The workbook can be useful for study meetings, but the team should avoid editing it manually and treating the edited copy as the new source of truth. If changes are needed, they should be made in the source database or the script, then regenerated. Outputs should include dates or version identifiers. A file named `summary.csv` is easy to overwrite. A file named `site_missing_summary_2026-06-01.csv` is more traceable. For formal reporting, the script version, export date, and dataset version should also be documented.
Part 3
The following code creates a processing summary: This small output helps future reviewers understand what the report was based on. More advanced workflows may include Git commit identifiers, package versions, or automated report parameters.