The Deepwater Horizon Incident is in the U.S. headlines and on many peoples minds. The folks over at Revolution Analytics were even discussing this subject today. Several government sites including the NOAA have sections dedicated to the problem. In fact, the EPA is concerned enough that they are eliciting technical solutions right on the site. In the “other” category they include a section on Data Collection and Management. So if you have any good ideas…
The following is a simple demonstration of how to retrieve the data related to water sampling from the EPA web site and to a quick survey of the data using R. The data is available from the Environmental Protection Agency in csv format. We start by reading this comma delimited data in:
data=read.table(‘http://www.epa.gov/bpspill/data/water_sampling_update.csv’, header=TRUE, skip=1,sep=”,”)
The current version of the report reports no immediate concern (quite literally – NA is returned):
The dates being tested in the current report are for a five day range (5/29/2010 – 6/2/2010).
A list of the substances being tested for results in the following:
Testing location (latitude and longitude) are also included in the data set. Using the maps R package, we can plot these locations on a map of Louisiana and create the image presented above.
map(“state”, “louisiana”, plot = TRUE, fill=TRUE, col=’white’)
points(x=data$LONGITUDE, y=data$LATITUDE, col=’red’,cex=0.75)
A close up of the area can also be obtained using the xlim and ylim parameters.
map(“state”, “louisiana”, plot = TRUE, fill=TRUE, col=’white’,xlim=range(x$LONGITUDE), ylim=range(x$LATITUDE))
points(x=x$LONGITUDE, y=x$LATITUDE, col=’red’,cex=0.75)
Although this is not a particularly deep analysis, it shows the relative ease by which data can be obtained and analyzed and visualized using R.