Mapping locations in R with the Data Science Toolkit
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Pete Warden's Data Science Toolkit (which we mentioned briefly last week) is an open-source information server that provides an API you can query for information useful for building data science applications, like identifying proper names in unstructured text, or converting IP addresses to lat/long coordinates. You can make queries via the Web interface or by direct interface to the API, but for R users Ryan Elmore has made the process much simpler by providing a package of R functions to make queries directly from R. The package, RDSTK, is currently available in source form on github; Ryan provides details and installation instructions on his blog, and you can the list of functions provided in the user manual.
Inspired by FlowingData's airline flight network charts (for which a handy step-by-step guide for producing such maps with great circles in R is now available), Ryan gave a presentation at the Denver R User Group[*] where he used the street2coordinates function of his RDSTK package to convert the hometowns of user group members (supplied in text form, like my own home town of “Adelaide, Australia”) into geographic coordinates, and display them on a map with Great Circles emanating from Denver:
Check out Ryan's slides for more examples of using the Data Science Toolkit from R, and if you're thinking about using R to interface to an API it's also a great example of interfacing with R via POST queries, JSON, and Curl.
[*] The Denver RUG is proudly sponsored by Revolution Analytics.
The Log Cabin: The RDSTK Presentation at Denver R Users Group
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.