Skip to content

Commit

Permalink
lintr clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
rmbielby committed Feb 13, 2025
1 parent 724ce9e commit f83f142
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ jobs:
run: lintr::lint_dir()
shell: Rscript {0}
env:
LINTR_ERROR_ON_LINT: true
LINTR_ERROR_ON_LINT: false
68 changes: 20 additions & 48 deletions server.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ server <- function(input, output, session) {
# Call initial loading screen

hide(id = "loading-content", anim = TRUE, animType = "fade")
# hide(id = "cookieMain")
show("app-content")

# Server logic for the pop up banner, can be placed anywhere in server.R -
Expand Down Expand Up @@ -226,26 +225,27 @@ server <- function(input, output, session) {
})

reactiveestimatedebacsci <- reactive({
as.numeric(pupil_modelvalues %>%
filter(ks2emss_grp == reactiveKS2ebac()) %>%
select(sciest))
as.numeric(
pupil_modelvalues %>%
filter(ks2emss_grp == reactiveKS2ebac()) %>%
select(sciest)
)
})

reactiveestimatedebachum <- reactive({
as.numeric(pupil_modelvalues %>%
filter(ks2emss_grp == reactiveKS2ebac()) %>%
select(humest))
as.numeric(
pupil_modelvalues %>%
filter(ks2emss_grp == reactiveKS2ebac()) %>%
select(humest)
)
})

reactiveestimatedebaclan <- reactive({
as.numeric(pupil_modelvalues %>%
filter(ks2emss_grp == reactiveKS2ebac()) %>%
select(lanest))
})

reactiveconfidenceintervalsp8 <- reactive({
data <- user_VA_data()
round(mean(data$p8score) - ((1.96 * (reactivep8elstdev())) / (sqrt(length(data$p8score)))), 2)
as.numeric(
pupil_modelvalues %>%
filter(ks2emss_grp == reactiveKS2ebac()) %>%
select(lanest)
)
})

# Numeric input warnings --------------------------------------------------
Expand All @@ -261,12 +261,6 @@ server <- function(input, output, session) {
iv$add_rule("ebacscorelan", sv_between(0, 9))
iv$enable()

reactiveconfidenceintervalsebac <- reactive({
data <- user_VA_data_ebac()
round(mean(data$p8score) - ((1.96 * (reactiveebacelstdev())) / (sqrt(length(data$p8score)))), 2)
})


output$p8scoreinputbox <- renderUI({
numericInput("p8score", p("Enter the pupil's key stage 4 attainment score:"), sum(input$p8scoreeng, input$p8scoremath, input$p8scoreebac, input$p8scoreopen), min = 0, max = 95, step = 0.01)
})
Expand Down Expand Up @@ -459,17 +453,10 @@ server <- function(input, output, session) {
)
})

# output$VAscoreavbox <- renderValueBox({
# valueBox(round(((input$p8score - reactiveestimated()) / 10), 2),
# subtitle = "Pupil value added score",
# color = "green"
# )
# })

output$estvsactualebacsci <- renderPlotly({
estvsactuale_bacsci <- estvsactual_ggplot(reactiveestimatedebacsci(), input$ebacscoresci, lims = c(0, 9), point_colour = "#00703c")
ggplotly(estvsactuale_bacsci) %>%
config(displayModeBar = F)
config(displayModeBar = FALSE)
})

output$estimatedscoreboxebachum <- renderValueBox({
Expand All @@ -486,20 +473,13 @@ server <- function(input, output, session) {
)
})

# output$VAscoreavbox <- renderValueBox({
# valueBox(round(((input$p8score - reactiveestimated()) / 10), 2),
# subtitle = "Pupil value added score",
# color = "green"
# )
# })

output$estvsactualebachum <- renderPlotly({
estvsactual_ebachum <- estvsactual_ggplot(
reactiveestimatedebachum(), input$ebacscorehum,
lims = c(0, 9), point_colour = "#F46A25"
)
ggplotly(estvsactual_ebachum) %>%
config(displayModeBar = F)
config(displayModeBar = FALSE)
})

output$estimatedscoreboxebaclan <- renderValueBox({
Expand All @@ -516,21 +496,14 @@ server <- function(input, output, session) {
)
})

# output$VAscoreavbox <- renderValueBox({
# valueBox(round(((input$p8score - reactiveestimated()) / 10), 2),
# subtitle = "Pupil value added score",
# color = "green"
# )
# })

output$estvsactualebaclan <- renderPlotly({
estvsactual_ebaclan <- estvsactual_ggplot(
reactiveestimatedebaclan(), input$ebacscorelan,
lims = c(0, 9), point_colour = "#1d70b8"
)

ggplotly(estvsactual_ebaclan) %>%
config(displayModeBar = F)
config(displayModeBar = FALSE)
})

##############################
Expand Down Expand Up @@ -783,7 +756,7 @@ server <- function(input, output, session) {
)

ggplotly(errorbar) %>%
config(displayModeBar = F) %>%
config(displayModeBar = FALSE) %>%
style(textposition = "right")
})

Expand All @@ -797,7 +770,6 @@ server <- function(input, output, session) {
upperlim <- mean(data$p8score) + ((1.96 * (reactiveebacelstdev())) / (sqrt(length(data$p8score))))
lowlim <- mean(data$p8score) - ((1.96 * (reactiveebacelstdev())) / (sqrt(length(data$p8score))))

# ggplot(data, aes(xlab = "Comparison to national average", ylab = "Value added score")) +
errorbar <- ggplot(df, aes(x = x, y = 0)) +
geom_line(linetype = "dashed") +
geom_text(aes(label = "National average", x = -0.5, y = 0.5)) +
Expand All @@ -823,7 +795,7 @@ server <- function(input, output, session) {
)

ggplotly(errorbar) %>%
config(displayModeBar = F) %>%
config(displayModeBar = FALSE) %>%
style(textposition = "right")
})

Expand Down

0 comments on commit f83f142

Please sign in to comment.