This R Markdown document is made interactive using Shiny. To learn more, see Interactive Documents.


if(!require("AnalyseGeotop"))
{
  if(!require("devtools"))
  {
    install.packages(devtools)
    require("devtools")
  }
  install_github("AnalyseGeotop", "JBrenn")
  require("AnalyseGeotop")
}

if(!require("dygraphs"))
{
  install.packages(dygraphs)
  require("dygraphs")
}

# if(!require(hydroGOF))
# {
#   install.packages(hydroGOF)
#   require(hydroGOF)
# }
# 
# if(!require(ggplot2))
# {
#   install.packages(ggplot2)
#   require(ggplot2)
# }

###wpath <- '/home/ecor/activity/2016/eurac2016/Muntatschini_pnt_1_225_B2_004' 
wpath <- '/home/ecor/temp/geotopOptim_tests/B2_BeG_017_DVM_001' 

#wpath <- "/run/user/1000/gvfs/smb-share:server=sdcalp01.eurac.edu,share=data2/Simulations/Simulation_GEOtop_1_225_ZH/Vinschgau/SimTraining/BrJ/HiResAlp/1D/Montecini_pnt_1_225_B2_007/"
#wpath <- "/run/user/1000/gvfs/smb-share:server=sdcalp01.eurac.edu,share=data2/Simulations/Simulation_GEOtop_1_225_ZH/Vinschgau/SimTraining/BrJ/MonaLisa/1D/Kaltern/sim006"
#wpath <- "/home/jbr/Schreibtisch/sim0/Kaltern_sim001"

# sim data
if (file.exists(file.path(wpath,"PointOut.RData"))) {
  load(file.path(wpath,"PointOut.RData"))
} else {
  out <- GEOtop_ReadPointData(wpath = wpath, save_rData = T)
}

Interactive Inputs

inputPanel(
  #textInput(inputId = "simFolder", label = "Simulation folder", value = "")

  selectInput(inputId = "variable1", label = "variable #1", choices = names(out), selected = "Tair.C."),

  selectInput(inputId = "variable2", label = "variable #2", choices = c("n.a.",names(out)), selected = "Tsurface.C."),

  selectInput(inputId = "variable3", label = "variable #3", choices = c("n.a.",names(out)), selected = "Tvegetation.C."),

  selectInput(inputId = "variable4", label = "variable #4", choices = c("n.a.",names(out)), selected = "Tcanopyair.C."),

  selectInput(inputId = "variable5", label = "variable #5", choices = c("n.a.",names(out)), selected = "PrainPsnow_over_canopy.mm."),

  radioButtons(inputId = "fromabove", label = "variable #5", choices = c("normal","from above"), selected = "from above", inline = FALSE)

#  radioButtons(inputId = "flux_amount", label = "flux or amount", choices = c("flux","amount"), selected = "flux", inline = FALSE)

  # radioButtons(inputId = "cum", label = "cumulated or time series", choices = c("time series","cumulated over time"), selected = "time series", inline = FALSE)

)

Time Series Plot

renderDygraph({

  forplot <- c(input$variable1, input$variable2, input$variable3, input$variable4, input$variable5)
  forplot <- forplot[forplot != "n.a."]

    data <- out[,forplot] 

    if (input$variable5 == "n.a.") {

          dygraph(data) %>%
            dyRangeSelector() %>%
            dyRoller()

    } else {

          if (input$fromabove == "from above") {
            data[,input$variable5] <- data[,input$variable5] * (-1)
            dygraph(data) %>%
              dyRangeSelector() %>%
              dyRoller() %>%
              dySeries(name = input$variable5, axis = "y2", stepPlot = TRUE, fillGraph = TRUE)
          } else {
            dygraph(data) %>%
            dyRangeSelector() %>%
            dyRoller()
          }


    }


})



ecor/geotopOptim documentation built on May 15, 2019, 8:54 p.m.