Does anyone know how to use rinat (github.com/ropensci/rinat) to download occurence data using phenology as a query parameter? I’d like to download all observations of a taxon, but I only want flowering individuals. It appears that rinat does not provide a column for phenology in the output dataframe, and it does not have an obvious function for pulling observations of a specific phenology state.
I’ve created a project to aggregate all flowering individuals from the taxon, and I can download the ovservations using the export feature of iNaturalist. However, I’d like to make reproducable code (specifically in R), and I don’t want to have to duplicate projects for every taxon I want to investigate.
i don’t really know anything about R or rinat, but it looks like the thing is built on top of the older iNat API (https://www.inaturalist.org/pages/api+reference), and as far as i can tell, it doesn’t look like there’s a way in the old API to reference annotations. so my guess would be that the only way to use rinat to pull in observations that are flowering only is to do what you did with a custom project.
are you actually using R to do additional number crunching, or are you just trying to pull down data? if you’re just trying to get data, there might be other ways to achieve that end.
I’m planning to do all downstream stuff in R (filtering, mapping, visualization, etc.), but I’m open to any methods of quickly retrieving occurrence data with phenology information included.
Once installed, the following code will get you what you want (including combining all pages of JSON data) into a single data frame as long as the request doesn’t exceed 10,000 records:
df <- iNat(taxon_id = [insert the number here], quality_grade = "research", term_id= 12 , term_value_id = 13)
For example this would be Yellow Coneflower:
df <- iNat(taxon_id = 85332, quality_grade = "research", term_id= 12 , term_value_id = 13)