From 0c69159c69d5d99a34229dd94b789184ded90b0b Mon Sep 17 00:00:00 2001 From: Danielle Callan Date: Wed, 29 Nov 2023 22:20:01 -0500 Subject: [PATCH] fix on-screen error about NULLs --- R/server.R | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/R/server.R b/R/server.R index d24f63e..ebaf722 100644 --- a/R/server.R +++ b/R/server.R @@ -119,6 +119,10 @@ server <- function(input, output, session) { filteredEdgeList <- reactive({ edgeList <- req(edgeList()) + if (is.null(edgeList)) { + return(NULL) + } + edgeList <- subset(edgeList, abs(edgeList$value) >= input$correlationFilter) edgeList <- subset(edgeList, edgeList$p_value <= input$pValueFilter) @@ -127,11 +131,18 @@ server <- function(input, output, session) { output$correlationMatrix <- DT::renderDT({ edgeList <- req(filteredEdgeList()) + return(edgeList) }) output$bipartiteNetwork <- renderBipartiteNetwork({ edgeList <- req(filteredEdgeList()) - bipartiteNetwork(edgeList, width = '100%', height = '400px') + + if (is.null(edgeList)) { + return(NULL) + } + + network <- bipartiteNetwork(edgeList, width = '100%', height = '400px') + return(network) }) }