2016年1月7日星期四

R Graphs 1

用R 來plot graph


Get data from: http://aqsdr1.epa.gov/aqsweb/aqstmp/airdata/download_files.html
Annual Summary Data > annual_all_2015.zip

pollution<-read .csv="" annual_all_2015.csv="" character="" colclasses="c(" data="" read--="" sep=",">
> PM25<-pollution -="" arameter.name="=" conditions="" font="" local="" pollution="">
> PM25<-pm25 aily="" etric.used="=" font="" mean="">
> PM25.mean<-as .numeric="" font="" rithmetic.mean="">
> summary(PM25.mean)

[1] "8.868966" "8.868966" "8.990909" "8.990909" "9.01"     "9.01"  
> summary(PM25.mean)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
 0.5839  7.0650  8.7450  8.6970 10.2000 37.9100 
 

Boxplot

 
> boxplot(PM25.mean,col="blue")


Histogram

 
 
> hist(PM25.mean, col="green")
 
 
 
 
> hist(PM25.mean, col="green")
> rug(PM25.mean)
> hist(PM25.mean, col="green", breaks=100)
> rug(PM25.mean)
 
 
 

Overlaying feature

> boxplot(PM25.mean,col="blue")
> abline(h=12)
> hist(PM25.mean, col="green")
> abline(v=12,lwd=2)
> abline(v = median(PM25.mean), col="red", lwd=4)



沒有留言:

發佈留言