http://www.epa.gov/ttn/airs/airsaqs/detaildata/downloadaqsdata.htm
R script is sourced from here:
Read file into R without header
Read the first line and convert it to become header
Make it as header name of data frame
make.names() can make the name more meaningful
summary(): see Min. Median, Mean, and Max values
mean(is.na()): to know how many percentage of NA value in the data, the example below is around 11%
Repeat above steps to read Y2013 data
boxplot(x0, x1), hard to see the result
The mean of Y2013 is lower then Y1999
Look at negative value
Convert date formate from int –> character –> date
site0 has 33, site1 has 21, both after intersect() has only 11
Make a new field, county.site. Then subset data that appear in both years
To see how many observation in county.site, for example, 63.2008 has 122 rows
Choose county 63 and side ID 2008
Plot x0sub data with wrong date format in x
Convert date format and plot again
Plot x1sub data with correct date format in x
Plot 2 subset in same panel, but the y ranges are different
Find global range and plot them again
Show state-wide means and make a plot showing trend
Convert mn0 to data frame, then merge mn0 and mn1
Connect lines between 2 points
沒有留言:
張貼留言