'error and warning messages in R console and blank downloaded plot in shiny app

i am fairly new to shiny. i am trying to build ui that has drop downs (and plots/data display) that are conditional on an initial selection field. i have made a simplified example using the USArrests data set...

https://gist.github.com/guyabel/4059ae889dea4b8ca0ca

or

shiny::runGist('4059ae889dea4b8ca0ca')

i have a couple of things that i can not figure out.

  1. i get error messages in the R console relating to the default plot (and subsequent plots).

    Warning in min(x) : no non-missing arguments to min; returning Inf

  2. i get error messages in the R console relating to the data...

    Warning in matrix(align.tmp[(2 - pos):(ncol(x) + 1)], nrow = nrow(x), ncol = ncol(x) + : data length exceeds size of matrix

  3. the download plot button returns a blank plot

  4. when i select all from the first drop down i get no plot. (i guess this is related to 1)?)

any ideas how to solve any of these (i think they might all be related)?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source