Package rinat use case: map of iNaturalist project

11 Mar

iNaturalist projects are collection of records posted on iNatualist. Now that we have a R package rinat from rOpenSci I thought of playing around with the data. Here is a function I wrote, to quickly map all the records of a project using ggmap package.


inatmap <- function(grpid){
  data1=get_inat_obs_project(grpid, type = "observations")
  map <-get_map(location =c(min(data1$Longitude),
                messaging = FALSE)
  p <-ggplot()
  p= ggmap(map)+geom_point(data=data1,

We can used get_inat_obs_project function from rinat package to get all the observation from the specified project. get_map function form ggmap package to download google maps base layer and ggplot function form ggplot2 package to actually plot the map with points.

Now call to the function with a group name will produce a map with all the records in the project.



We can use other ggplot options to add title, legend etc. to the map. This is just a simple example.

About these ads

One Response to “Package rinat use case: map of iNaturalist project”

  1. Vijay Barve March 17, 2014 at 3:04 am #

    Nice work! Scatter density maps with a land mask would be a useful addition. – L. Shyamal on G+

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 404 other followers

%d bloggers like this: