I’m just finishing up a Data Science for Biology course at UMASS Boston, and as the final project had to make an interactive web app with R. I ended up creating an app that, given an iNaturalist username, downloads the users observation data set and generates a number of visualizations, tables, and maps regarding their usage of iNat. The app has really been a hit among the iNat users on UMASS Boston’s Biology faculty, so I thought I share it with the community. Enjoy!
P.S. may take a few minutes to load the visualizations depending on how many observations a user has. I also put a cap at 10,000 observations for performance, so if you have more than that this only uses your last 10k.
Jonathan Layman
Medford, Massachusetts
UMASS Boston Biology class of 2020
Oops, accidentally deleted. Just was saying, that it is very cool and thanks for sharing! One problem though, I keep getting an error (“ An error has occurred. Check your logs or contact the app author for clarification.”) when I go to the “Top Species” tab.
I just ran your username through the app, and while it took a minute to load, the data table in the top species tab loaded just fine. It may be that shinyapps.io had a momentary issue.
If you run into error messages, try reopening the app; I believe that this is a shinyapps issue due to the amount of traffic. Shinyapps is by no means a perfect platform. @zorrosidekick got your errors after the first try, but the app worked for your username after I restarted it.
I thought the most interesting thing was the “month” graph. This month so far I’ve been feeling really bogged down, suddenly too busy to do as much observing as I’d like… and now I see that according to my stats I always have a May slump! March and April are really high, June-July-August-September really high, but May is just low. Must be May is always my spring “crunch time” for non-iNat things. There’s also a noticeable spike in December- must be when the cabin fever really hits.
there may be more efficient ways to collect user stats than to aggregate / visualize after downloading a user’s entire set of observations, especially if the user has a lot of observations. i think each of the things you’re showing can be accomplished via specific API endpoint (http://api.inaturalist.org/v1/docs/):
Major Taxa – do a Get Observations request for each iconic taxon, returning just one record for each request with only the id, and then use the total_results value from each result set.
Top Species – use the Get Observations Species Counts endpoint
Quality Grade – do a Get Observations request for each quality grade, returning just one record for each request with only the id, and then use the total_results value from each result set.
Month – use the Get Observations Histogram endpoint
Map – use the Observations Tiles set of your choice, plus the associated UTFGrid if you want to be able to show associated details when clicking on a marker.
what you created may be a good learning exercise, and it may work for many use cases, but you may want to consider making it more efficient if you find that other people start using it a lot.
@pisum This was for a class on programming with R. The package for interfacing with iNaturalist and getting data, rinat, is still being developed, and currently can’t do any of those things outright- hence my brute force approach of downloading all observations and manipulating the data afterwards to achieve my objectives.
@abersbird bird The R package for handling iNaturalist data, rinat, currently doesn’t have the ability to access identification data, so I wouldn’t be able to do so without figuring out how to use the API.
Just to clarify – rinat is apparently no longer being developed. CRAN dropped the rinat package in January due to lack of response from the developers (see here). Looking at the rinat GitHub page (github.com/ropensci/rinat), there’s been almost no work done on it since last summer.
Okay, that’s what it does when it’s working. You enter a user name, hit enter, and it does nothing, giving no hint of whether or not it’s working, for a long time. And then you get graphs and stuff. Some kind of loading / processing indication would be nice.