Skip to content

Commit

Permalink
feat(app): add lines 4 and 5 to explorer, but it has errors if not 5 …
Browse files Browse the repository at this point in the history
…lines being displayed
  • Loading branch information
amyheather committed Oct 21, 2024
1 parent 73b6bcd commit 2c006bc
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion shinyapp/explorer.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ comparators = c(
"Everolimus" = "everolimus",
"Axitinib" = "axitinib",
"Sorafenib" = "sorafenib",
"Best supportive care" = "placebo_BSC")
"Best supportive care" = "BSC")

# Define list of populations (labels and values)
populations = c(
Expand Down Expand Up @@ -100,6 +100,16 @@ server <- function(input, output) {
seq <- seq[seq$V3 == input$l2_chosen,]
return(seq)
})
seq_line3 <- reactive({
seq <- seq_line2()
seq <- seq[seq$V4 == input$l3_chosen,]
return(seq)
})
seq_line4 <- reactive({
seq <- seq_line3()
seq <- seq[seq$V5 == input$l4_chosen,]
return(seq)
})

# Reactive display of possible treatments for each line
output$line1 <- renderUI({
Expand All @@ -116,13 +126,29 @@ server <- function(input, output) {
choices = comparators[comparators %in% l2_values],
inline=TRUE)
})

output$line3 <- renderUI({
l3_values <- unique(seq_line2()$V4)
radioButtons(inputId = "l3_chosen",
label = "Third line treatment",
choices = comparators[comparators %in% l3_values],
inline=TRUE)
})

output$line4 <- renderUI({
l4_values <- unique(seq_line3()$V5)
radioButtons(inputId = "l4_chosen",
label = "Fourth line treatment",
choices = comparators[comparators %in% l4_values],
inline=TRUE)
})
output$line5 <- renderUI({
l5_values <- unique(seq_line4()$V6)
radioButtons(inputId = "l5_chosen",
label = "Fifth line treatment",
choices = comparators[comparators %in% l5_values],
inline=TRUE)
})
}

# ====================
Expand Down

0 comments on commit 2c006bc

Please sign in to comment.