############################ INTERACTIVE STATS PLOTS ############################# ### AMET CODE: AQ_Stats_Plots_leaflet.R ### ### This code takes a MYSQL database query for a single species from one or more ### networks and a single simulation and calculates summary statistics for each site ### and the entire domain by network. Interactive spatial plots using the leaflet and ### the htmlwidgets R libraries are produced for select statistics, specifically MB, ME, ### FB, FE, NMB, NME, RMSE and Correlation. Images are output as html files and can be ### self-contained using PANDOC. If PANDOC is unavailable, the selfcontained options at ### the end of this code should be set to false. ### ### Last modified by Wyat Appel; March 2019 ################################################################################## Loading required package: RMySQL Loading required package: DBI Loading required package: fields Loading required package: spam Loading required package: dotCall64 Loading required package: grid Spam version 2.6-0 (2020-12-14) is loaded. Type 'help( Spam)' or 'demo( spam)' for a short introduction and overview of this package. Help for individual functions is also obtained by adding the suffix '.spam' to the function name, e.g. 'help( chol.spam)'. Attaching package: ‘spam’ The following objects are masked from ‘package:base’: backsolve, forwardsolve See https://github.com/NCAR/Fields for an extensive vignette, other supplements and source code Loading required package: leaflet Loading required package: htmlwidgets Loading required package: maps Loading required package: mapdata [1] "SELECT d.network,d.stat_id,s.lat,s.lon,d.ob_dates,d.ob_datee,d.ob_hour,d.month , d.SO4_ob, d.SO4_mod ,d.POCode,s.state from ARDEQ_TRIAL2datbase_mysql as d, site_metadata as s WHERE d.SO4_ob is not NULL and d.network='IMPROVE' and s.stat_id=d.stat_id and d.ob_dates BETWEEN 20160701 and 20160731 and d.ob_datee BETWEEN 20160701 and 20160731 and ob_hour between 0 and 23 ORDER BY stat_id,ob_dates,ob_hour" Error in data.frame(Network = I(network), Site_ID = I(sites), lat = lats, : arguments imply differing number of rows: 1, 0 In addition: There were 13 warnings (use warnings() to see them) Error: $ operator is invalid for atomic vectors Execution halted