This is a Shiny app that filters and summarizes data from an Excel file. Here’s a breakdown of the code:
Data Loading
The app loads data from an Excel file using the readxl package.
Filtering
The user can select two filter inputs: district_name and school_year. The app uses these filters to narrow down the data.
Summary
When the user clicks the “Run” button, the app runs a reactive function that performs the following steps:
- Data Filtering: It filters the data based on the selected values for
district_nameandschool_year. - Population and Gender Combinations: It creates two new columns:
Student Group(which represents Population) andGender. The app then splits this column into three categories: “Male”, “Female”, and “All”. - Summarizing Numerator and Denominator: It calculates the sum of numerator and denominator values for each row.
- Interleaving Columns: It interleaves the columns representing numerator and denominator values.
- Rearranging Columns: It rearranges the columns to have a consistent order.
Output
The app displays the filtered data in a table, using the renderDataTable function from Shiny.
UI/Server Separation
The code separates the UI and server logic into two separate files: ui.R and server.R. The ui.R file defines the user interface, while the server.R file contains the server-side logic.
Overall, this app appears to be designed to summarize data from an Excel file based on filter inputs provided by the user.
Last modified on 2024-08-18