R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree" Copyright (C) 2015 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. [Previously saved workspace restored] > ametbase <- Sys.getenv("AMETBASE") > dbase <- Sys.getenv("AMET_DATABASE") > out_dir <- Sys.getenv("AMET_OUT") > ametRinput <- Sys.getenv("AMETRINPUT") > config_file <- Sys.getenv("MYSQL_CONFIG") # MySQL configuration file > ametR <- paste(ametbase,"/R_analysis_code",sep="") # R directory > > source(ametRinput) > source(config_file) > source(paste(ametR,"/AQ_Misc_Functions.R",sep="")) # Miscellanous AMET R-functions file ###################################### SPATIAL PLOT ###################################### ### AMET CODE: AQ_Plot_Spatial.R ### ### This code is part of the AMET-AQ system. The Plot Spatial code takes a MYSQL database ### query for a single species from one or more networks and plots the observation value, ### model value, and difference between the model and ob for each site for each corresponding ### network. Mutiple values for a site are averaged to a single value for plotting purposes. ### The map area plotted is dynamically generated from the input data. ### ### Last modified by Wyat Appel: June, 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.5-1 (2019-12-12) 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 Loading required package: maps See https://github.com/NCAR/Fields for an extensive vignette, other supplements and source code Warning message: In FUN(X[[i]], ...) : failed to assign RegisteredNativeSymbol for toeplitz to toeplitz since toeplitz is already defined in the ‘spam’ namespace > > if(!require(RMySQL)){stop("Required Package RMySQL was not loaded")} > mysql <- list(login=amet_login, passwd=amet_pass, server=mysql_server, dbase=dbase, maxrec=maxrec) # Set MYSQL login and query options > > ################################### > ### Does not need to be changed ### > ################################### > states <- c("All") > #states <- c("AL","AK","AZ","AR","CA","CO","CT","DE","DC","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY") > #states <- c("AZ","CA","CO","ID","IA","KS","MT","NE","NV","NM","ND","OK","OR","SD","TX","UT","WA","WY") # Western States > ################################### > > ###################################### > ####### Configuration Options ######## > ###################################### > run_name1 <- Sys.getenv("AMET_PROJECT") # AMET project name > run_name2 <- Sys.getenv("AMET_PROJECT2") # Additional run to include on plot > #start_date <- "20060101" # Set the start date of the analysis > #end_date <- "20061231" # Set the end date of the analysis > > #batch_query <- c("month=1","month=2","month=3","month=4","month=5","month=6","month=7","month=8","month=9","month=10","month=11","month=12", > # "(month=12 or month=1 or month=2)", > # "(month=3 or month=4 or month=5)", > # "(month=6 or month=7 or month=8)", > # "(month=9 or month=10 or month=11)") > #batch_names <- c("January","February","March","April","May","June","July","August","September","October","November","December", > # "Winter","Spring","Summer","Fall") > ####################################### > > ##################### > ### Other Options ### > ##################### > > ### Custom Title ### > custom_title <- "" > ############################## > > ### Set default value for by_site flag ### > if(!exists("by_site")) { + print("by_site flag not set. Defaulting to n. Set by_site flag in config file to create plots by individual site id.") + by_site <- "n" + } > if ((by_site == 'T') || (by_site == "t") || (by_site == "Y")) { by_site <- "y" } > > ### Main Database Query String. ### > query_string<-paste(" and s.stat_id=d.stat_id and d.ob_dates >=",start_date,"and d.ob_datee <=",end_date,additional_query,sep=" ") > #query_string2<-paste(" and d.ob_dates >=",start_date,"and d.ob_datee <=",end_date,additional_query,sep=" ") > > ### Set and create output directory ### > #out_dir <- paste(out_dir,"bar_plots",sep="/") > mkdir_main_command <- paste("mkdir -p",out_dir,sep=" ") > system(mkdir_main_command) # This will create a subdirectory with the name of the project > ####################################### > > run_script_command1 <- paste(amet_base,"/R_analysis_code/AQ_Stacked_Barplot.R",sep="") > run_script_command2 <- paste(amet_base,"/R_analysis_code/AQ_Stacked_Barplot_AE6.R",sep="") > run_script_command3 <- paste(amet_base,"/R_analysis_code/AQ_Stacked_Barplot_soil.R",sep="") > run_script_command4 <- paste(amet_base,"/R_analysis_code/AQ_Stacked_Barplot_soil_multi.R",sep="") > #run_script_command5 <- paste(amet_base,"/R_analysis_code/AQ_Stacked_Barplot_panel.R",sep="") > #run_script_command6 <- paste(amet_base,"/R_analysis_code/AQ_Stacked_Barplot_panel_AE6.R",sep="") > #run_script_command7 <- paste(amet_base,"/R_analysis_code/AQ_Stacked_Barplot_panel_AE6_multi.R",sep="") > run_script_command5 <- paste(amet_base,"/R_analysis_code/AQ_Stacked_Barplot_AE6_ggplot.R",sep="") > run_script_command6 <- paste(amet_base,"/R_analysis_code/AQ_Stacked_Barplot_AE6_plotly.R",sep="") > > ############################################################################################### > ### This portion of the code will create seasonal soccer goal plots for the various species ### > ############################################################################################### > > #for (m in 1:length(batch_query)) { # Create a subdirectory for each month > # mkdir_command <- paste("mkdir -p ",out_dir,"/",batch_names[m],sep="") > # system(mkdir_command) > #} > for (m in 1:length(batch_query)) { + species_list <- c("PM_TOT","soil") + for (i in 1:length(species_list)) { + species_in <- species_list[i] + dates <- batch_names[m] + figdir <- paste(out_dir,species_in,sep="/") + if (batch_names[m] != "None") { + figdir <- paste(out_dir,batch_names[m],species_in,sep="/") + } + mkdir_command <- paste("mkdir -p",figdir) + network_names <- c("CSN") + network_label <- c("CSN") + pid <- network_names + query <- paste(query_string,"and (",batch_query[m],")",sep="") + sites <- "All" + if (by_site == 'y') { + qs <- paste("SELECT distinct(d.stat_id) from ",run_name1," as d, site_metadata as s where d.network = '",network_names,"' ",query,sep="") + sites.df <- db_Query(qs,mysql) + sites <- sites.df$stat_id + if (length(sites) == 0) { sites <- "All" } + } + for (s in 1:length(sites)) { + if (sites[s] != "All") { + pid <- paste(network_label,sites[s],sep="_") + query <- paste(query_string," and (",batch_query[m],") and d.stat_id ='",sites[s],"'",sep="") + site <- sites[s] + } + if (species_in == "PM_TOT") { + if (AE5_barplot == 'y') { + system(mkdir_command) + try(source(run_script_command1)) + } + if (AE6_barplot == 'y') { + system(mkdir_command) + try(source(run_script_command2)) + try(source(run_script_command5)) + try(source(run_script_command6)) + } + } + if (species_in == "soil") { + if (soil_barplot == 'y') { + system(mkdir_command) + try(source(run_script_command3)) + } + } + } + } + } ############################### AE6 STACKED BAR PLOT ################################# ### AMET CODE: AQ_Stacked_Barplot_AE6.R ### ### This code creates a stacked bar plot of PM species from the IMPROVE, CSN, SEARCH or ### AQS Daily networks. Data are then averaged for SO4, NO3, NH4, EC, OC soil species, ### NCOM, PMother and total PM2.5. These averages are then plotted on a stacked bar plot, ### along with the percent of the total PM2.5 that each species comprises. ### ### Last updated by Wyat Appel: June, 2019 ###################################################################################### [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.NO3_ob, d.NO3_mod, d.NH4_ob, d.NH4_mod, d.PM_TOT_ob, d.PM_TOT_mod, d.PM_FRM_ob, d.PM_FRM_mod, d.EC_ob, d.EC_mod, d.OC_ob, d.OC_mod, d.TC_ob, d.TC_mod, d.soil_ob, d.soil_mod, d.NaCl_ob, d.NaCl_mod, d.NCOM_ob, d.NCOM_mod, d.OTHER_ob, d.OTHER_mod, d.OTHER_REM_ob, d.OTHER_REM_mod ,d.POCode,s.state from PXM_LandUse_AQ as d, site_metadata as s WHERE d.SO4_ob is not NULL and d.network='CSN' and s.stat_id=d.stat_id and d.ob_dates >= 20100310 and d.ob_datee <= 20100410 and (d.ob_dates between 20100310 and 20100410 and d.ob_datee between 20100310 and 20100410) ORDER BY stat_id,ob_dates,ob_hour" Error in .local(conn, statement, ...) : could not run statement: Unknown column 'd.SO4_ob' in 'field list' ############################### AE6 STACKED BAR PLOT ################################# ### AMET CODE: AQ_Stacked_Barplot_AE6_ggplot.R ### ### This code creates a stacked bar plot of PM species from the IMPROVE, CSN, SEARCH or ### AQS Daily networks using the ggplot R package. Data are then averaged for SO4, NO3, ### NH4, EC, OC soil species, NCOM, PMother and total PM2.5. These averages are then ### plotted as a stacked bar plot, along with the percent of the total PM2.5 that each ### species comprises. ### ### Last updated by Wyat Appel: June, 2019 ###################################################################################### Error in library(plotly) : there is no package called ‘plotly’ ############################## AE6 STACKED BAR PLOT ################################## ### AMET CODE: AQ_Stacked_Barplot_AE6_ggplot.R ### ### This code creates an interactive stacked bar plot of PM species from the IMPROVE, CSN, ### SEARCH or AQS Daily networks using the plotly R package. Data are then averaged for SO4, ### NO3, NH4, EC, OC soil species, NCOM, PMother and total PM2.5. These averages are then ### plotted on a stacked bar plot, along with the percent of the total PM2.5 that each species ### comprises. ### ### Last updated by Wyat Appel: June, 2019 ####################################################################################### Error in library(plotly) : there is no package called ‘plotly’ ############################## AE6 STACKED BAR PLOT ################################ ### AMET CODE: AQ_Stacked_Barplot_soil.R ### ### This code creates a stacked bar plot of soil species for up to two simulations from ### a single network (i.e. CSN, IMPROVE, AQS Daily). Output format is png, pdf or both. ### ### Last updated by Wyat Appel: June, 2019 #################################################################################### [1] "SELECT d.network,d.stat_id,s.lat,s.lon,d.ob_dates,d.ob_datee,d.ob_hour,d.month , d.Cl_ob, d.Cl_mod, d.Na_ob, d.Na_mod, d.Fe_ob, d.Fe_mod, d.Al_ob, d.Al_mod, d.Si_ob, d.Si_mod, d.Ti_ob, d.Ti_mod, d.Ca_ob, d.Ca_mod, d.Mg_ob, d.Mg_mod, d.K_ob, d.K_mod, d.Mn_ob, d.Mn_mod ,d.POCode,s.state from PXM_LandUse_AQ as d, site_metadata as s WHERE d.Fe_ob is not NULL and d.network='CSN' and s.stat_id=d.stat_id and d.ob_dates >= 20100310 and d.ob_datee <= 20100410 and (d.ob_dates between 20100310 and 20100410 and d.ob_datee between 20100310 and 20100410) ORDER BY stat_id,ob_dates,ob_hour" Error in .local(conn, statement, ...) : could not run statement: Unknown column 'd.Cl_ob' in 'field list' > > for (m in 1:length(batch_query)) { + species_list <- c("PM_TOT","soil") + for (i in 1:length(species_list)) { + species_in <- species_list[i] + dates <- batch_names[m] + figdir <- paste(out_dir,species_in,sep="/") + if (batch_names[m] != "None") { + figdir <- paste(out_dir,batch_names[m],species_in,sep="/") + } + mkdir_command <- paste("mkdir -p",figdir) + network_names <- c("IMPROVE") + network_label <- c("IMPROVE") + pid <- network_names + query <- paste(query_string,"and (",batch_query[m],")",sep="") + sites <- "All" + if (by_site == 'y') { + qs <- paste("SELECT distinct(d.stat_id) from ",run_name1," as d, site_metadata as s where d.network = '",network_names,"' ",query,sep="") + sites.df <- db_Query(qs,mysql) + sites <- sites.df$stat_id + if (length(sites) == 0) { sites <- "All" } + } + for (s in 1:length(sites)) { + if (sites[s] != "All") { + pid <- paste(network_label,sites[s],sep="_") + query <- paste(query_string," and (",batch_query[m],") and d.stat_id ='",sites[s],"'",sep="") + site <- sites[s] + } + if (species_in == "PM_TOT") { + if (AE5_barplot == 'y') { + system(mkdir_command) + try(source(run_script_command1)) + } + if (AE6_barplot == 'y') { + system(mkdir_command) + try(source(run_script_command2)) + try(source(run_script_command5)) + try(source(run_script_command6)) + try(source(run_script_command7)) + } + } + if (species_in == "soil") { + if (soil_barplot == 'y') { + system(mkdir_command) + try(source(run_script_command3)) + } + } + } + } + } ############################### AE6 STACKED BAR PLOT ################################# ### AMET CODE: AQ_Stacked_Barplot_AE6.R ### ### This code creates a stacked bar plot of PM species from the IMPROVE, CSN, SEARCH or ### AQS Daily networks. Data are then averaged for SO4, NO3, NH4, EC, OC soil species, ### NCOM, PMother and total PM2.5. These averages are then plotted on a stacked bar plot, ### along with the percent of the total PM2.5 that each species comprises. ### ### Last updated by Wyat Appel: June, 2019 ###################################################################################### [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.NO3_ob, d.NO3_mod, d.NH4_ob, d.NH4_mod, d.PM_TOT_ob, d.PM_TOT_mod, d.PM_FRM_ob, d.PM_FRM_mod, d.EC_ob, d.EC_mod, d.OC_ob, d.OC_mod, d.TC_ob, d.TC_mod, d.soil_ob, d.soil_mod, d.NaCl_ob, d.NaCl_mod, d.NCOM_ob, d.NCOM_mod, d.OTHER_ob, d.OTHER_mod, d.OTHER_REM_ob, d.OTHER_REM_mod ,d.POCode,s.state from PXM_LandUse_AQ 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 >= 20100310 and d.ob_datee <= 20100410 and (d.ob_dates between 20100310 and 20100410 and d.ob_datee between 20100310 and 20100410) ORDER BY stat_id,ob_dates,ob_hour" Error in .local(conn, statement, ...) : could not run statement: Unknown column 'd.SO4_ob' in 'field list' ############################### AE6 STACKED BAR PLOT ################################# ### AMET CODE: AQ_Stacked_Barplot_AE6_ggplot.R ### ### This code creates a stacked bar plot of PM species from the IMPROVE, CSN, SEARCH or ### AQS Daily networks using the ggplot R package. Data are then averaged for SO4, NO3, ### NH4, EC, OC soil species, NCOM, PMother and total PM2.5. These averages are then ### plotted as a stacked bar plot, along with the percent of the total PM2.5 that each ### species comprises. ### ### Last updated by Wyat Appel: June, 2019 ###################################################################################### Error in library(plotly) : there is no package called ‘plotly’ ############################## AE6 STACKED BAR PLOT ################################## ### AMET CODE: AQ_Stacked_Barplot_AE6_ggplot.R ### ### This code creates an interactive stacked bar plot of PM species from the IMPROVE, CSN, ### SEARCH or AQS Daily networks using the plotly R package. Data are then averaged for SO4, ### NO3, NH4, EC, OC soil species, NCOM, PMother and total PM2.5. These averages are then ### plotted on a stacked bar plot, along with the percent of the total PM2.5 that each species ### comprises. ### ### Last updated by Wyat Appel: June, 2019 ####################################################################################### Error in library(plotly) : there is no package called ‘plotly’ Error in file(filename, "r", encoding = encoding) : cannot open the connection In addition: Warning message: In file(filename, "r", encoding = encoding) : cannot open file '/home/pkasper/AMET_v14/R_analysis_code/AQ_Plot_Spatial_Diff_interactive.R': No such file or directory ############################## AE6 STACKED BAR PLOT ################################ ### AMET CODE: AQ_Stacked_Barplot_soil.R ### ### This code creates a stacked bar plot of soil species for up to two simulations from ### a single network (i.e. CSN, IMPROVE, AQS Daily). Output format is png, pdf or both. ### ### Last updated by Wyat Appel: June, 2019 #################################################################################### [1] "SELECT d.network,d.stat_id,s.lat,s.lon,d.ob_dates,d.ob_datee,d.ob_hour,d.month , d.Cl_ob, d.Cl_mod, d.Na_ob, d.Na_mod, d.Fe_ob, d.Fe_mod, d.Al_ob, d.Al_mod, d.Si_ob, d.Si_mod, d.Ti_ob, d.Ti_mod, d.Ca_ob, d.Ca_mod, d.Mg_ob, d.Mg_mod, d.K_ob, d.K_mod, d.Mn_ob, d.Mn_mod ,d.POCode,s.state from PXM_LandUse_AQ as d, site_metadata as s WHERE d.Fe_ob is not NULL and d.network='IMPROVE' and s.stat_id=d.stat_id and d.ob_dates >= 20100310 and d.ob_datee <= 20100410 and (d.ob_dates between 20100310 and 20100410 and d.ob_datee between 20100310 and 20100410) ORDER BY stat_id,ob_dates,ob_hour" Error in .local(conn, statement, ...) : could not run statement: Unknown column 'd.Cl_ob' in 'field list' > > for (m in 1:length(batch_query)) { + species_list <- c("PM_TOT") + for (i in 1:length(species_list)) { + species_in <- species_list[i] + dates <- batch_names[m] + figdir <- paste(out_dir,species_in,sep="/") + if (batch_names[m] != "None") { + figdir <- paste(out_dir,batch_names[m],species_in,sep="/") + } + mkdir_command <- paste("mkdir -p",figdir) + network_names <- c("AQS_Daily") + network_label <- c("AQS_Daily") + pid <- network_names + query <- paste(query_string,"and (",batch_query[m],")",sep="") + sites <- "All" + if (by_site == 'y') { + qs <- paste("SELECT distinct(d.stat_id) from ",run_name1," as d, site_metadata as s where d.network = '",network_names,"' ",query,sep="") + sites.df <- db_Query(qs,mysql) + sites <- sites.df$stat_id + if (length(sites) == 0) { sites <- "All" } + } + for (s in 1:length(sites)) { + if (sites[s] != "All") { + pid <- paste(network_label,sites[s],sep="_") + query <- paste(query_string," and (",batch_query[m],") and d.stat_id ='",sites[s],"'",sep="") + site <- sites[s] + } + if (species_in == "PM_TOT") { + if (AE5_barplot == 'y') { + system(mkdir_command) + try(source(run_script_command1)) + } + if (AE6_barplot == 'y') { + system(mkdir_command) + try(source(run_script_command2)) + try(source(run_script_command5)) + try(source(run_script_command6)) + try(source(run_script_command7)) + } + } + } + } + } ############################### AE6 STACKED BAR PLOT ################################# ### AMET CODE: AQ_Stacked_Barplot_AE6.R ### ### This code creates a stacked bar plot of PM species from the IMPROVE, CSN, SEARCH or ### AQS Daily networks. Data are then averaged for SO4, NO3, NH4, EC, OC soil species, ### NCOM, PMother and total PM2.5. These averages are then plotted on a stacked bar plot, ### along with the percent of the total PM2.5 that each species comprises. ### ### Last updated by Wyat Appel: June, 2019 ###################################################################################### [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.NO3_ob, d.NO3_mod, d.NH4_ob, d.NH4_mod, d.PM_TOT_ob, d.PM_TOT_mod, d.PM_FRM_ob, d.PM_FRM_mod, d.EC_ob, d.EC_mod, d.OC_ob, d.OC_mod, d.TC_ob, d.TC_mod, d.soil_ob, d.soil_mod, d.NaCl_ob, d.NaCl_mod, d.NCOM_ob, d.NCOM_mod, d.OTHER_ob, d.OTHER_mod, d.OTHER_REM_ob, d.OTHER_REM_mod ,d.POCode,s.state from PXM_LandUse_AQ as d, site_metadata as s WHERE d.SO4_ob is not NULL and d.network='AQS_Daily' and s.stat_id=d.stat_id and d.ob_dates >= 20100310 and d.ob_datee <= 20100410 and (d.ob_dates between 20100310 and 20100410 and d.ob_datee between 20100310 and 20100410) ORDER BY stat_id,ob_dates,ob_hour" Error in .local(conn, statement, ...) : could not run statement: Unknown column 'd.SO4_ob' in 'field list' ############################### AE6 STACKED BAR PLOT ################################# ### AMET CODE: AQ_Stacked_Barplot_AE6_ggplot.R ### ### This code creates a stacked bar plot of PM species from the IMPROVE, CSN, SEARCH or ### AQS Daily networks using the ggplot R package. Data are then averaged for SO4, NO3, ### NH4, EC, OC soil species, NCOM, PMother and total PM2.5. These averages are then ### plotted as a stacked bar plot, along with the percent of the total PM2.5 that each ### species comprises. ### ### Last updated by Wyat Appel: June, 2019 ###################################################################################### Error in library(plotly) : there is no package called ‘plotly’ ############################## AE6 STACKED BAR PLOT ################################## ### AMET CODE: AQ_Stacked_Barplot_AE6_ggplot.R ### ### This code creates an interactive stacked bar plot of PM species from the IMPROVE, CSN, ### SEARCH or AQS Daily networks using the plotly R package. Data are then averaged for SO4, ### NO3, NH4, EC, OC soil species, NCOM, PMother and total PM2.5. These averages are then ### plotted on a stacked bar plot, along with the percent of the total PM2.5 that each species ### comprises. ### ### Last updated by Wyat Appel: June, 2019 ####################################################################################### Error in library(plotly) : there is no package called ‘plotly’ Error in file(filename, "r", encoding = encoding) : cannot open the connection In addition: Warning message: In file(filename, "r", encoding = encoding) : cannot open file '/home/pkasper/AMET_v14/R_analysis_code/AQ_Plot_Spatial_Diff_interactive.R': No such file or directory > > for (m in 1:length(batch_query)) { + species_list <- c("PM_TOT","soil") + for (i in 1:length(species_list)) { + species_in <- species_list[i] + dates <- batch_names[m] + figdir <- paste(out_dir,species_in,sep="/") + if (batch_names[m] != "None") { + figdir <- paste(out_dir,batch_names[m],species_in,sep="/") + } + mkdir_command <- paste("mkdir -p",figdir) + network_names <- c("CSN","IMPROVE") + network_label <- c("CSN","IMPROVE") + pid <- "multi_network" + query <- paste(query_string,"and (",batch_query[m],")",sep="") + sites <- "All" + if (by_site == 'y') { + qs <- paste("SELECT distinct(d.stat_id) from ",run_name1," as d, site_metadata as s where d.network = '",network_names,"' ",query,sep="") + sites.df <- db_Query(qs,mysql) + sites <- sites.df$stat_id + if (length(sites) == 0) { sites <- "All" } + } + for (s in 1:length(sites)) { + if (sites[s] != "All") { + pid <- paste(network_label,sites[s],sep="_") + query <- paste(query_string," and (",batch_query[m],") and d.stat_id ='",sites[s],"'",sep="") + site <- sites[s] + } + if (species_in == "soil") { + if (soil_multi_barplot == 'y') { + system(mkdir_command) + try(source(run_script_command4)) + } + } + if (species_in == "PM_TOT") { + # if (panel_AE6_multi_barplot == 'y') { + # system(mkdir -p_command) + # try(source(run_script_command7)) + # } + } + } + } + } ############################## AE6 STACKED BAR PLOT ############################### ### AMET CODE: AQ_Stacked_Barplot_soil_multi.R ### ### This code creates a stacked bar plot of soil species for up to two networks ### (i.e. CSN, IMPROVE, AQS Daily). Single simulation. Output format is png, pdf or ### both. ### ### Last updated by Wyat Appel: June, 2019 ################################################################################### [1] "SELECT d.network,d.stat_id,s.lat,s.lon,d.ob_dates,d.ob_datee,d.ob_hour,d.month , d.Cl_ob, d.Cl_mod, d.Na_ob, d.Na_mod, d.Fe_ob, d.Fe_mod, d.Al_ob, d.Al_mod, d.Si_ob, d.Si_mod, d.Ti_ob, d.Ti_mod, d.Ca_ob, d.Ca_mod, d.Mg_ob, d.Mg_mod, d.K_ob, d.K_mod, d.Mn_ob, d.Mn_mod ,d.POCode,s.state from PXM_LandUse_AQ as d, site_metadata as s WHERE d.Fe_ob is not NULL and d.network='CSN' and s.stat_id=d.stat_id and d.ob_dates >= 20100310 and d.ob_datee <= 20100410 and (d.ob_dates between 20100310 and 20100410 and d.ob_datee between 20100310 and 20100410) ORDER BY stat_id,ob_dates,ob_hour" Error in .local(conn, statement, ...) : could not run statement: Unknown column 'd.Cl_ob' in 'field list' > > #################################### > ### End Monthly Analysis Section ### > #################################### > > proc.time() user system elapsed 1.120 0.040 1.196