Skip to content

Commit

Permalink
cater for mismatch in project's number of observations
Browse files Browse the repository at this point in the history
  • Loading branch information
stragu committed Feb 19, 2021
1 parent 8b8002c commit c951fbd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: rinat
Type: Package
Title: Access 'iNaturalist' Data Through APIs
Version: 0.1.6.9000
Date: 2020-10-13
Version: 0.1.7
Date: 2021-02-19
Authors@R: c(
person("Vijay", "Barve", role = "aut", email = "[email protected]",
comment = c(ORCID = "0000-0002-4852-2567")),
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# rinat 0.1.6.9000 (development version)
# rinat 0.1.7

* ...
* Cater for a corner case in which a mismatch between a project's reported number of observations and the actual number of observations returned produced an error when merging data frames in `get_inat_obs_project()`

# rinat 0.1.6

Expand Down
3 changes: 3 additions & 0 deletions R/get_inat_obs_project.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ get_inat_obs_project <- function(grpid, type = c("observations", "info"), raw =
}
obs_list[[i]] <-
fromJSON(content(GET(url1), as = "text"), flatten = TRUE)
# break if < 200 rows, in case of mismatch between info and reality
# (problem has been observed)
if (nrow(obs_list[[i]]) != 200) break
}
project_obs <- do.call("rbind.fill", obs_list)
return(project_obs)
Expand Down

0 comments on commit c951fbd

Please sign in to comment.