
R- geo examples
Get flash to fully experience Pearltrees
Use GBIF and googleVis to Make Maps with Species Occurrence Data
As part of my Google Summer of Code, I am also working on another package for R called rvertnet . This package is a wrapper in R for VertNet websites. Vertnet is a vertebrate distributed database network consisting of FishNet2 , MaNIS , HerpNET , and ORNIS . Out of that currently Fishnet, HerpNET and ORNIS have their v2 portals serving data. rvertnet has functions now to access this data and import them into R data frames. Some of my lab mates faced a difficulty in downloading data for Scrub Jay ( Aphelocoma spp. ) due to large number of records (220k+) on ORNIS, so decided to try using rvertnet package which was still in development that time. The package really helpe and got the results quickly.
Blue Jay and Scrub Jay : Using rvertnet to check the distributions in R
John Snow’s famous cholera analysis data in modern GIS formats
In 1854 there was a massive cholera outbreak in Soho, London – in three days over 120 people died from the disease. Famously, John Snow plotted the locations of the deaths on a map and found they clustered around a pump in Broad Street – he suggested that the pump be taken out of service – thus helping to end the epidemic. This then helped him formulate his theory of the spread of cholera by dirty water. This analysis is famous as it is often considered to be:Coming of Age: R and Spatial Data Visualisation
I have been using R (a free statistics and graphics software package) now for the past four years or so and I have seen it become an increasingly powerful method of both analysing and visualising spatial data. Crucially, more and more people are writing accessible tutorials ( see here ) for beginners and intermediate users and the development of packages such as ggplot2 have made it simpler than ever to produce fantastic graphics. You don’t get the interactivity you would with conventional GIS software such as ArcGIS when you produce the visualisation but you are much more flexible in terms of the combinations of plot types and the ease with which they can be combined. It is, for example, time consuming to produce multivariate symbols (such as those varying in size and colour) in ArcGIS but with R it is as simple* as one line of code. I have, for example, been able to add subtle transitions in the lines of the migration map above.The map above shows the routes flown by the top 7 airlines (by international passenger distance flown) . The base map shows large urban areas and I have attempted to make it look a bit like the beautiful “ Earth at Night ” composite image produced by NASA. You can clearly see a relationship between where people live and where the big carriers fly to across Europe and the US but India and much of China have relatively few routes. I expect much of the slack is picked up by smaller airlines in these countries but they must represent key growth areas the world economy becomes increasingly driven by the east. This map isn’t meant to be comprehensive- I just wanted to make another example of a visualisation with ggplot2.
Mapping the World’s Biggest Airlines
Mapped: British and Spanish Shipping 1750-1800
Spatial Data with R
As I was getting a root canal last week, my dental X-Rays reminded me anew of an optical illusion that stumped us for a short time recently when we were developing our heatmapping engine. My X-Rays, before during and after a recent root canal. They reminded me, of course, about cartography. Dentists, or at least dental radiologists looking at dental X-Rays, are probably familiar with the pesky phenomena of Mach Banding . It is an optical illusion that presents itself when contrasting tones are viewed right next to each other in the context of lightness gradients.
Where the Worlds of Dentistry and Cartography Collide
Plot maps like a boss
Creating web applications with Rwui The information that Rwui needs in order to create a web application for running an R script is entered on a series of web forms. Using these forms the statistician designs the web application they wish to construct. After entering a title and introductory text for the application, the input items that will appear on the application's web page are selected.
Source Code for Biology and Medicine | Full text | Creating web applications for spatial epidemiological analysis and mapping in R using Rwui
PostGIS Quickie
Today I needed to cut out a rectangle of geologic data from a state-wide map in an AEA coordinate system, using a bounding box from a UTM zone 10 region, with the output saved in UTM zone 10 coordinates. PostGIS makes this type of operation very simple via spatial SQL. Note the special syntax that PostgreSQL uses for referencing variables. Spatial SQL Example -- set our query geometry as a variable for use later \ SET query_geom ST_Transform ( SetSRID ( ST_MakeBox2d ( ST_Point ( 675461 , 4168366 ) , ST_Point ( 749990 , 4260786 ) ) , 26910 ) , 9001 ) -- save the result of our query to a temp table for export CREATE TEMP TABLE tt AS SELECT ST_Transform ( ST_Intersection ( wkb_geometry , :query_geom ) , 26910 ) AS wkb_geometry , ptype , ptype_full , gen_type , note FROM cageo JOIN cageo_legend USING ( ptype ) WHERE ST_Intersects ( wkb_geometry , :query_geom ) ;Create a user friendly web interface for an R script
Rwui running on new server, Java 1.6 and Tomcat 6, or later, now required to run webapps created by Rwui. Copy of Rwui, with older Java and Tomcat requirements for running the webapps it creates, still available at http://xenakis.mrc-bsu.cam.ac.uk/Rwui, but please note old version has not been updated with recent additions (on 20/06/12). Window's users please note points 13.1 and 15.1 in the Help file. A user friendly web interface for an R script means your script can be used by anyone, even if they have no knowledge of R. Rwui creates web applications for you for running R scripts. All the code is generated automatically so that a fully functional web interface for an R script can be downloaded and up and running in a matter of minutes...The dismo package is awesome: with some short lines of code you can read & map species distribution data from GBIF (the global biodiversity information facility) easily: Read more » To leave a comment for the author, please follow the link and comment on his blog: theBioBucket* . R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization ( ggplot2 , Boxplots , maps , animation ), programming ( RStudio , Sweave , LaTeX , SQL , Eclipse , git , hadoop , Web Scraping ) statistics ( regression , PCA , time series , ecdf , trading ) and more... <p style="text-align:right;color:#A8A8A8"></p>
Retrieve GBIF Species Occurrence Data with Function from dismo Package
Producing Google Map Embeds with R Package googleVis
(1) for producing html code for a Google Map with R-package googleVis do something like: (2) then just copy-paste the html to your blog or website after customizing for your purpose.. To leave a comment for the author, please follow the link and comment on his blog: theBioBucket* . R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization ( ggplot2 , Boxplots , maps , animation ), programming ( RStudio , Sweave , LaTeX , SQL , Eclipse , git , hadoop , Web Scraping ) statistics ( regression , PCA , time series , ecdf , trading ) and more... <p style="text-align:right;color:#A8A8A8"></p>Below is a link to a pdf (compiled with the amazing knitr package) and some accompanying data for a recent short course I gave on basic spatial data import/analysis/visualization in R. The class was only two hours and some of the participants were being exposed to R for the first time so the material is limited. The class was a follow up to a previous one I did on ArcGIS. The idea was to show how to perform the same functions in R and ArcGIS and then let users decide which worked best for them (I use R for about 90% of my spatial analysis and data handling but find ArcGIS (or some GUI based GIS) pretty essential for that last 10%). The content/main points of the course:

