I believe I have followed the instructions to create a reprex of my code. If something is wrong feel free to let me know! I apologize for any mistakes with the reprex, this is my first time producing one. I have also provided extra information at the bottom to assist with any confusion.
#Libraries Used
library(httr)
library(jsonlite)
library(ggplot2)
library(dplyr)
#Sample Data Set
data.frame(stringsAsFactors=FALSE,
data_cbsa = c("Asheville, NC", "Charlotte-Concord-Gastonia,
NC-SC", "Cullowhee, NC", "Durham-Chapel Hill, NC",
"Fayetteville, NC", "Greensboro-High Point, NC",
"Greenville, NC", "Hickory-Lenoir-Morganton, NC",
"Kinston, NC", "Morehead City, NC", "Oxford, NC", "Raleigh,
NC", "Rocky Mount, NC", "Sanford, NC", "Wilmington,
NC", "Winston-Salem, NC"),
data_year = c(2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017,
2017, 2017, 2017, 2017, 2017, 2017, 2017, 2017),
highest_4th_max_cbsa = c(0.063, 0.068, 0.064, 0.061, 0.063, 0.065, 0.061,
0.063, 0.062, 0.057, 0.065, 0.066, 0.061, 0.059,
0.057, 0.066)
#Minimal Runnable Code
> ggplot(o3_cbsa_annual_2015_std_summary,
+ aes(x=data_year, y=highest_4th_max_cbsa)) +
+ geom_col(position = "dodge", aes(fill = keys)) +
+ facet_wrap(~Subject, ncol = 4)
Error: At least one layer must contain all faceting variables: `Subject`.
* Plot is missing `Subject`
* Layer 1 is missing `Subject`
#Extra Info
Data was acquired from an online server that required a username and password
data_mart_api_user<- "" #enter username
data_mart_api_password<- "" #enter password
my_state<-"37"
my_state_name<-"North Carolina"
begin_date<-"20170101"
end_date<-"20171231"
base_url<-"https://aqs.epa.gov/data/api/"
request_type<-"monitors/byState?"
my_param<-"44201"