Blog Archives

Spatio-Temporal Kriging in R

August 27, 2015
By
Spatio-Temporal Kriging in R

PrefaceI am writing this post more for reminding to myself some theoretical background and the steps needed to perform spatio-temporal kriging in gstat. This month I had some free time to spend on small projects not specifically related to my primary occupation. I decided to spend some time trying to learn this technique since it may become useful in...

Read more »

Organize a walk around London with R

June 21, 2015
By
Organize a walk around London with R

The subtitle of this post can be "How to plot multiple elements on interactive web maps in R".In this experiment I will show how to include multiple elements in interactive maps created using both plotGoogleMaps and leafletR. To complete the work prese...

Read more »

Cluster analysis on earthquake data from USGS

June 1, 2015
By
Cluster analysis on earthquake data from USGS

Theoretical BackgroundIn some cases we would like to classify the events we have in our dataset based on their spatial location or on some other data. As an example we can return to the epidemiological scenario in which we want to determine if the spread of a certain disease is affected by the presence of a particular source of...

Read more »

Live Earthquake Map with Shiny and Google Map API

May 27, 2015
By
Live Earthquake Map with Shiny and Google Map API

In the post Exchange data between R and the Google Maps API using Shiny I presented a very simple way to allow communication between R and javascript using shiny.This is an example of a practical approach for which that same system can be used to create a useful tool to visualize seismic events collected from USGS in...

Read more »

Interactive maps of Crime data in Greater London

May 25, 2015
By
Interactive maps of Crime data in Greater London

In the previous post we looked at ways to perform some introductory point pattern analysis of open data downloaded from Police.uk. As you remember we subset the dataset of crimes in the Greater London area, extracting only the drug related ones. Subseq...

Read more »

Introductory Point Pattern Analysis of Open Crime Data in London

May 21, 2015
By
Introductory Point Pattern Analysis of Open Crime Data in London

IntroductionPolice in Britain (http://data.police.uk/) not only register every single crime they encounter, and include coordinates, but also distribute their data free on the web.They have two ways of distributing data: the first is through an API, which is extremely easy to use but returns only a limited number of crimes for each request, the second is...

Read more »

Introductory Time-Series analysis of US Environmental Protection Agency (EPA) pollution data

May 18, 2015
By
Introductory Time-Series analysis of US Environmental Protection Agency (EPA) pollution data

Download EPA air pollution data The US Environmental Protection Agency (EPA) provides tons of free data about air pollution and other weather measurements through their website. An overview of their offer is available here: http://www.epa.gov/airdata/T...

Read more »

Interactive maps for the web in R

May 15, 2015
By
Interactive maps for the web in R

Static MapsIn the last post I showed how to download economic data from the World Bank's website and create choropleth maps in R (Global Economic Maps).In this post I want to focus more on how to visualize those maps.Sp PackageProbably the simplest way...

Read more »

Global Economic Maps

May 12, 2015
By
Global Economic Maps

IntroductionIn this post I am going to show how to extract data from web pages in table format, transform these data into spatial objects in R and then plot them in maps.ProcedureFor this project we need the following two packages: XML and raster.The first package is used to extract data from HTML pages, in particular from the sections marked...

Read more »

Exchange data between R and the Google Maps API using Shiny

May 10, 2015
By

A couple of years ago I wrote a post about using Shiny to exchange data between the Google Maps API and R: http://r-video-tutorial.blogspot.ch/2013/07/interfacing-r-and-google-maps.htmlBack then as far as I remember Shiny did not allow a direct exchange of data between javascript, therefore I had to improvise and extract data indirectly using an external table. In other words, that work was not...

Read more »