Skip to content

Commit

Permalink
#214 attempting to return photos data in inat results
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Mar 1, 2019
1 parent 065037e commit df0e82c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Description: A programmatic interface to many species occurrence data sources,
System ('OBIS'), and Atlas of Living Australia ('ALA'). Includes
functionality for retrieving species occurrence data, and combining
those data.
Version: 0.9.0.9310
Version: 0.9.0.9311
License: MIT + file LICENSE
Authors@R:
c(person(given = "Scott",
Expand Down
10 changes: 5 additions & 5 deletions R/inat.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
spocc_inat_obs <- function(query=NULL, taxon = NULL, quality=NULL, geo=TRUE,
year=NULL, month=NULL, day=NULL, bounds=NULL,
date_start = NULL, date_end = NULL,
maxresults=100, page=NULL, callopts) {
year=NULL, month=NULL, day=NULL, bounds=NULL, date_start = NULL,
date_end = NULL, maxresults=100, page=NULL, callopts) {

# input parameter checks
if (!is.null(quality)) quality <- match.arg(quality, c("casual","research"))
Expand Down Expand Up @@ -76,11 +75,12 @@ spocc_inat_obs <- function(query=NULL, taxon = NULL, quality=NULL, geo=TRUE,
call. = FALSE)
}

# photos_con <- list()
page_query <- c(args, per_page = 200, page = 1)
data <- cli$get(path = ping_path, query = page_query)
data <- spocc_inat_handle(data)
data_out <- jsonlite::fromJSON(data, flatten = TRUE)
data_out$photos <- NULL
# data_out$photos <- NULL
data_out$tag_list <- sapply(data_out$tag_list, function(x) {
if (length(x) == 0) "" else paste0(x, collapse = ", ")
})
Expand All @@ -92,7 +92,7 @@ spocc_inat_obs <- function(query=NULL, taxon = NULL, quality=NULL, geo=TRUE,
data <- cli$get(path = ping_path, query = page_query)
data <- spocc_inat_handle(data)
data_out2 <- jsonlite::fromJSON(data, flatten = TRUE)
data_out2$photos <- NULL
# data_out2$photos <- NULL
data_out2$tag_list <- sapply(data_out2$tag_list, function(x) {
if (length(x) == 0) "" else paste0(x, collapse = ", ")
})
Expand Down
3 changes: 2 additions & 1 deletion man-roxygen/occ_egs.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#' res$ebird
#' (res <- occ(query = 'Danaus plexippus', from = 'inat', limit = 50))
#' res$inat
#' res$inat$data
#' data.table::rbindlist(res$inat$data$Danaus_plexippus$photos)
#' (res <- occ(query = 'Bison bison', from = 'bison', limit = 50))
#' res$bison
#' (res <- occ(query = 'Bison bison', from = 'vertnet', limit = 5))
Expand All @@ -21,7 +23,6 @@
#' one$gbif
#' two$gbif
#'
#'
#' # Date range searches across data sources
#' ## Not possible for ebird
#' ## bison
Expand Down
3 changes: 2 additions & 1 deletion man/occ.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit df0e82c

Please # to comment.