Skip to content

Commit df0e82c

Browse files
committed
#214 attempting to return photos data in inat results
1 parent 065037e commit df0e82c

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Description: A programmatic interface to many species occurrence data sources,
88
System ('OBIS'), and Atlas of Living Australia ('ALA'). Includes
99
functionality for retrieving species occurrence data, and combining
1010
those data.
11-
Version: 0.9.0.9310
11+
Version: 0.9.0.9311
1212
License: MIT + file LICENSE
1313
Authors@R:
1414
c(person(given = "Scott",

R/inat.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
spocc_inat_obs <- function(query=NULL, taxon = NULL, quality=NULL, geo=TRUE,
2-
year=NULL, month=NULL, day=NULL, bounds=NULL,
3-
date_start = NULL, date_end = NULL,
4-
maxresults=100, page=NULL, callopts) {
2+
year=NULL, month=NULL, day=NULL, bounds=NULL, date_start = NULL,
3+
date_end = NULL, maxresults=100, page=NULL, callopts) {
54

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

78+
# photos_con <- list()
7979
page_query <- c(args, per_page = 200, page = 1)
8080
data <- cli$get(path = ping_path, query = page_query)
8181
data <- spocc_inat_handle(data)
8282
data_out <- jsonlite::fromJSON(data, flatten = TRUE)
83-
data_out$photos <- NULL
83+
# data_out$photos <- NULL
8484
data_out$tag_list <- sapply(data_out$tag_list, function(x) {
8585
if (length(x) == 0) "" else paste0(x, collapse = ", ")
8686
})
@@ -92,7 +92,7 @@ spocc_inat_obs <- function(query=NULL, taxon = NULL, quality=NULL, geo=TRUE,
9292
data <- cli$get(path = ping_path, query = page_query)
9393
data <- spocc_inat_handle(data)
9494
data_out2 <- jsonlite::fromJSON(data, flatten = TRUE)
95-
data_out2$photos <- NULL
95+
# data_out2$photos <- NULL
9696
data_out2$tag_list <- sapply(data_out2$tag_list, function(x) {
9797
if (length(x) == 0) "" else paste0(x, collapse = ", ")
9898
})

man-roxygen/occ_egs.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#' res$ebird
99
#' (res <- occ(query = 'Danaus plexippus', from = 'inat', limit = 50))
1010
#' res$inat
11+
#' res$inat$data
12+
#' data.table::rbindlist(res$inat$data$Danaus_plexippus$photos)
1113
#' (res <- occ(query = 'Bison bison', from = 'bison', limit = 50))
1214
#' res$bison
1315
#' (res <- occ(query = 'Bison bison', from = 'vertnet', limit = 5))
@@ -21,7 +23,6 @@
2123
#' one$gbif
2224
#' two$gbif
2325
#'
24-
#'
2526
#' # Date range searches across data sources
2627
#' ## Not possible for ebird
2728
#' ## bison

man/occ.Rd

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)