[This article was first published on What You're Doing Is Rather Desperate » R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Visit this URL and you’ll find a perfectly-formatted CSV file containing information about recent earthquakes. A nice feature of R is the ability to slurp such a URL straight into a data frame:
quakes <- read.csv("http://neic.usgs.gov/neis/gis/qed.asc", header = T) colnames(quakes) # [1] "Date" "TimeUTC" "Latitude" "Longitude" "Magnitude" "Depth" # number of recent quakes nrow(quakes) # [1] 3135 # biggest recent quake subset(quakes, quakes$Magnitude == max(quakes$Magnitude, na.rm = T)) # Date TimeUTC Latitude Longitude Magnitude Depth # 2060 2010/02/27 06:34:14.0 -35.993 -72.828 8.8 35
I hear a lot about the “web of data” and the “linked data web” but honestly, I’ll be happy the day people start posting data as delimited, plain text instead of HTML and PDF files.
Filed under: programming, R, research diary, statistics, web resources Tagged: open data, www
To leave a comment for the author, please follow the link and comment on their blog: What You're Doing Is Rather Desperate » R.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.