Check if the node has valid attributes and data before extracting data from it.
Warning: Error in <-: 'names' attribute [1] must be the same length as the vector [0]
168: get_and_preprocess_observations [D:\cs 424\Chicago-RealTime-AQ/app.R#639]
167: renderPlot [D:\cs 424\Chicago-RealTime-AQ/app.R#1455]
We have to come up with a working way of storing the latest node click (in map and table independently) in the same variable so that it can be used easily in the future.
This happens when clicking on light blue node and then another light blue node, it might be similar to issue #10 that I solved putting some other constraints like
retrieved_measures <- unique(df$measure)
if ("so2" %in% c(input$measures1,input$measures2) && "so2" %in% retrieved_measures){
and so on..
Error:
Warning: Error in : Aesthetics must be either length 1 or the same as the data (43): y
182: stop
181: check_aesthetics
180: f
179: l$compute_aesthetics
178: f
177: by_layer
176: ggplot_build.ggplot
174: print.ggplot
166: func
164: f
163: Reduce
154: do
153: hybrid_chain
125: drawPlot
111: reactive:plotObj
95: drawReactive
82: origRenderFunc
81: output$graphical_data_last_ds
1: runApp
Since we have to show the table with true/false and it takes up a lot of space but is not necessary to have it always there, we could put a switch on the sidebar to hide and show the table (this could be done via js easily as I was doing it with the project 2).
The main panel with data will probably have to be even bigger to show better the plots (bigger width, so we can't have 2 big panels always showing, no space for the map itself.
I don't know how it's possible but Dark Sky with my key has already done 1000 requests today and yesterday, how many different requests happen when clicking on a single node?
The error presented in the console is:
Warning: Error in get_forecast_for: Forbidden (HTTP 403).
181:
We might want to consider using different keys and switching randomly between them