CSV Summary Report
Build an R tool that takes any CSV file and produces a clear summary report: how many rows and columns it has, which values are missing and where, counts for each category, and averages of numeric columns broken down by a group you choose. You'll first write it as a script using the tidyverse, then wrap it in a small Shiny app where you upload a file, pick the grouping column, and see the tables update. It's a practical introduction to R: reading data with readr, summarizing with dplyr, reshaping with tidyr, and building a simple interactive interface.
- Estimate
- ~9.5h
- Steps
- 6
- Completed by
- 0
- Proposed by
- codeseed.app
tidyverse · Shiny
Project roadmap
- 01
Set up the project and sample data
~1hInstall R and RStudio, then install the tidyverse and shiny packages. Create an RStudio project with a data/ folder containing a sample CSV (for example a small sales or student dataset) with at least 200 rows, a few categorical and numeric columns, and some empty cells. Done when: the project opens in RStudio and read_csv loads the sample file.
- 02
Write an overview function
~1.5hIn R/summary.R, write overview(df) that returns a data frame with one row per column: the column name, its type, the number of missing values, the percentage missing, and the number of distinct values. Done when: calling overview() on the sample data returns the correct table.
- 03
Summarize categories and numbers
~2hWrite category_counts(df, column), which returns each value of a categorical column with its count and percentage, largest first, and numeric_by_group(df, group), which returns the count, mean, median and standard deviation of every numeric column for each group value, rounded to two decimals. Ignore missing values in the calculations. Done when: both functions return correct tables for the sample data.
- 04
Handle messy input
~1.5hMake the functions safe with real-world files: stop with a clear message if the file is empty or the chosen column doesn't exist, handle a dataset with no numeric columns, and treat empty strings as missing. Done when: each of these cases gives a readable message instead of a cryptic R error.
- 05
Wrap it in a Shiny app
~2hCreate app.R with a fileInput for the CSV, a selectInput for the grouping column (filled from the file's columns) and three tables: the overview, the category counts for the chosen column, and the numeric summary by group. Use the sample data until a file is uploaded. Done when: uploading a CSV and changing the column updates all three tables.
- 06
Add tests
~1.5hInstall testthat and write tests in tests/testthat/ for the three functions using a tiny data frame built in the test: correct missing counts, correct group means, and the error message for a missing column. Done when: testthat::test_dir("tests/testthat") passes.
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack