Skip to content

Commit

Permalink
Merge pull request #25 from dfe-analytical-services/feedback_variance
Browse files Browse the repository at this point in the history
Feedback - variance buttons
  • Loading branch information
katie-aisling authored Jan 16, 2025
2 parents 8a28bca + 83ae0e2 commit cd740db
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
15 changes: 14 additions & 1 deletion R/dashboard_panels.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,25 @@ homepage_panel <- function() {
)
),
br(),
p("The underlying national model data used by this app to calculate each student's value added result can also be downloaded as a .csv file"),
p("The underlying data used by this app to calculate each student's value added result and the confidence intervals can be downloaded here as .csv files.
These files include the national model data, the subject variance data, and the subject variance data for the disadvantaged cohort."),
downloadButton(
outputId = "model_data_download",
label = "Model data (csv, 500KB)",
icon = NULL,
class = "gov-uk-button-secondary"
),
downloadButton(
outputId = "subject_variance_download",
label = "Subject variance (csv, 50KB)",
icon = NULL,
class = "gov-uk-button-secondary"
),
downloadButton(
outputId = "disadvantaged_subject_variance_download",
label = "Disadvantaged subject variance (csv, 50KB)",
icon = NULL,
class = "gov-uk-button-secondary"
)
)
)
Expand Down
16 changes: 15 additions & 1 deletion server.R
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ server <- function(input, output, session) {
# })

# -----------------------------------------------------------------------------------------------------------------------------
# ---- USER TEMPLATES - OUTPUT IN THE DATA UPLOAD TAB ----
# ---- UNDERLYING DATA DOWNLOADS - OUTPUT IN THE DATA UPLOAD TAB ----
# -----------------------------------------------------------------------------------------------------------------------------

output$model_data_download <- downloadHandler(
Expand All @@ -209,6 +209,20 @@ server <- function(input, output, session) {
}
)

output$subject_variance_download <- downloadHandler(
filename = "subject_variance_data.csv",
content = function(file) {
write.csv(data$subject_variance, file, row.names = FALSE)
}
)

output$disadvantaged_subject_variance_download <- downloadHandler(
filename = "disadvantaged_subject_variance_data.csv",
content = function(file) {
write.csv(data$disadvantaged_subject_variance, file, row.names = FALSE)
}
)

# -----------------------------------------------------------------------------------------------------------------------------
# ---- USER TEMPLATES - OUTPUT IN THE DATA UPLOAD TAB ----
# -----------------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit cd740db

Please sign in to comment.