Journal archives for May 2020

May 04, 2020

4. R script tellingen

Here’s the little R script I used to make that fig from the iNat API

ere’s the little R script I used to make that fig from the iNat API
library(jsonlite)
options(timeout= 4000000)
dat <- fromJSON("http://api.inaturalist.org/v1/observations/histogram?date_field=created&interval=month&verifiable=true")
x = c()
y = c()
for(i in 1:(length(dat$results$month))){
x = c(x,names(dat$results$month[i]))
y = c(y,dat$results$month[[i]])
}

par(mfrow=c(1,1))
xx = (1:length(y))
plot(xx,y, type="l", axes=FALSE, xlab="", ylab="Observations per month", xlim=c(40,length(xx)))
points(xx,y, type="l", lty=2)
axis(2)
axis(1,which(strptime(x,"%Y-%m-%d")$yday==0),(2019-length(which(strptime(x,"%Y-%m-%d")$yday==0))+1):2019)
abline(h=1000000, lty=2)

Here’s the little R script I used to make that fig from the iNat API

Posted on May 04, 2020 23:44 by ahospers ahospers | 2 comments | Leave a comment