server_files/sip.R

observe({
  output$sipPlot <- renderPlot({
    validate(
      need(
        !is.null(input$dataFile),
        'Please choose a datafile !'
      ),
      need(
        K() > 1,
        'Requires more than one error set !'
      )
    )

    if(is.null(bsList())) {
      # Populate bsList
      S = estBS1 (Errors,
                  props  = "mse",
                  do.sip = TRUE,
                  silent = TRUE)
      bsList(S)
    } else if(is.null(bsList()$sip)) {
      # Update bsList
      S = bsList()
      S0 = estBS1 (Errors,
                  props  = "mse",
                  do.sip = TRUE,
                  silent = TRUE)
      S$sip = S0$sip
      bsList(S)
    } else {
      # Load bsList
      S = bsList()
    }

    ErrViewLib::plotSIPMat(
      S$sip,
      cex.lab = input$sipCexLab,
      gPars = gPars)

  },
  # width  = round(plotWidth  * K()^0.5 / nomSize),
  # height = round(plotHeight * K()^0.5 / nomSize)
  width  = 1.25*plotWidth, height = plotHeight
  )
})
ppernot/ErrView documentation built on Jan. 30, 2022, 6:59 a.m.