title: wide data format as input to a Shiny mapview app - reactive wrapper(s) needed?
body: <p>I'm having trouble using columns from data originating in wide format as dynamic inputs to a Shiny map app.</p>
  
  <p>In the app I'm hoping to be able to: </p>
  
  <ul>
  <li>select a parameter of point data (sample data below: 16 locations, 6 parameters) in a drop down type menu and adjust the symbol size to represent the selected parameter's absolute values with a slider (to help visualize positive and negative differences from zero)</li>
  <li>with any parameter selected, retain ability to see all parameters (the columns) in <code>mapview</code>'s popup feature (<code>mapview</code> turns the columns into rows for the popup). It seems a filtered long format <code>data.frame</code> would be missing data from the popup/viewing perspective</li>
  <li>retain the (non absolute) original value on the mouseover hover label (eg the <code>-7.3</code> in the image)</li>
  </ul>
  
  <p>In addition to having those features, I don't know if/where I need to set reactive wrapper(s)? Or, maybe I could do everything more easily with another map-centric library (even though <code>mapview</code> is awesome for many things)? </p>
  
  <p>My attempts are commented out below - the UI works as intended except without drop down selectability - the app is limited to only one working dropdown parameter with <code>mapview(df["param1"]</code> and <code>cex = param1 * input$cex</code>.</p>
  
  <p>Here's the reproducible <code>app.r</code>:</p>
  
  <pre><code>library(tidyverse)
  library(sf)
  library(shiny)
  library(shinydashboard)
  library(leaflet)
  library(mapview)
  
  ## sample earthquake data ##
  set.seed(6)
  lat &lt;- rnorm(16,-34, 9)
  lon &lt;- rnorm(16,-67,.3)
  param1 &lt;- rnorm(16, 10, 40)   %&gt;% round(1)
  param2 &lt;- rnorm(16, 25, 3)    %&gt;% round(1)
  param3 &lt;- rnorm(16, -18, 10)  %&gt;% round(1)
  param4 &lt;- rnorm(16, -200, 93) %&gt;% round(1)
  param5 &lt;- rnorm(16, 0.1, .09) %&gt;% round(1)
  param6 &lt;- rnorm(16, 417, 33)  %&gt;% round(1)
  df &lt;- data.frame(lat, lon, param1, param2, param3, param4, param5, 
  param6) 
  df &lt;- st_as_sf(df, coords = c("lon", "lat"), crs = 4326) 
  paramchoices &lt;- colnames(df) %&gt;% .[.!="geometry"]
  colorpal = mapviewPalette("mapviewSpectralColors") 
  
  ui &lt;- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(  
  sliderInput("cex", "Symbol Size",
              min = 0.000001, max = 10, value = 1, step = 0.000001
  ),
  selectizeInput(
  
    "parameter", "Earthquake Parameter", choices = paramchoices, 
    selected = c("param1"), 
    multiple = FALSE)
  ),
  dashboardBody(
  tags$style(type = "text/css", "#mapplot {height: calc(100vh - 80px) !important;}"),
  leafletOutput("mapplot")
  )
  )
  
  server &lt;- function(input, output) {
  
  # df &lt;- reactive ({
  #   df %&gt;% mutate(selectedparameter = input$parameter,
  #                 selectedparameter_abs = abs(selectedparameter))
  # })
  
  output$mapplot &lt;- renderLeaflet({
                 m &lt;-   mapview(df["param1"], #mouseover column
                 #m &lt;- mapview(df["selectedparameter"],
                 cex = param1 * input$cex,  #marker size column
                 #cex = df$selectedparameter_abs * input$cex, 
                 col.regions = colorpal(100), 
                 alpha.regions = 0.3,
                 legend = TRUE,
                 popup = popupTable(df),
                 layer.name =  "selectedparam[unit]") 
   m@map     
  }
  )}
  shinyApp(ui, server)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/JauWg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JauWg.png" alt="enter image description here"></a></p>
  
  <p>more info related to the absolute value part - <a href="https://stackoverflow.com/questions/56743265/point-color-and-symbol-size-based-on-different-variables-in-mapview">Point color and symbol size based on different variables in mapview</a></p>
  
  <p>thank you.</p>