Commit 6677be01 authored by dmattek's avatar dmattek

Changed checks for NULL data to validate-need syntax.

parent ef30c0f0
...@@ -125,12 +125,6 @@ modAUCplot = function(input, output, session, ...@@ -125,12 +125,6 @@ modAUCplot = function(input, output, session,
# Boxplot - display # Boxplot - display
output$outPlotBox = renderPlot({ output$outPlotBox = renderPlot({
locBut = input$butPlot
if (locBut == 0) {
cat(file = stderr(), 'aucPlot:Go button not pressed\n')
return(NULL)
}
plotBox() plotBox()
...@@ -138,12 +132,6 @@ modAUCplot = function(input, output, session, ...@@ -138,12 +132,6 @@ modAUCplot = function(input, output, session,
output$outPlotBoxInt = renderPlotly({ output$outPlotBoxInt = renderPlotly({
locBut = input$butPlot
if (locBut == 0) {
cat(file = stderr(), 'aucPlot:Go button not pressed\n')
return(NULL)
}
# This is required to avoid # This is required to avoid
# "Warning: Error in <Anonymous>: cannot open file 'Rplots.pdf'" # "Warning: Error in <Anonymous>: cannot open file 'Rplots.pdf'"
...@@ -180,13 +168,16 @@ modAUCplot = function(input, output, session, ...@@ -180,13 +168,16 @@ modAUCplot = function(input, output, session,
plotBox <- function() { plotBox <- function() {
cat(file = stderr(), 'aucPlot:plotBox\n') cat(file = stderr(), 'aucPlot:plotBox\n')
loc.dt = in.data() # make the f-n dependent on the button click
locBut = input$butPlot
cat(file = stderr(), "plotBox: on to plot\n\n") # Check if main data exists
if (is.null(loc.dt)) { # Thanks to solate all mods in the left panel are delayed
cat(file = stderr(), 'plotBox: dt is NULL\n') # until clicking the Plot button
return(NULL) loc.dt = isolate(in.data())
} validate(
need(!is.null(loc.dt), "Nothing to plot. Load data first!")
)
cat(file = stderr(), 'plotBox:dt not NULL\n') cat(file = stderr(), 'plotBox:dt not NULL\n')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment