diff --git a/R/ppo_data.R b/R/ppo_data.R index 5a1c1c1..d74f809 100644 --- a/R/ppo_data.R +++ b/R/ppo_data.R @@ -189,7 +189,7 @@ make_queryURL <- function(params, limit = 100000L) { } process_response <- function(results, keepData = FALSE) { - if (!length(results) || results$status_code != 200) + if (!length(results) | (length(results) && results$status_code != 200)) list( "data" = NULL, "readme" = NULL, diff --git a/R/ppo_traits.R b/R/ppo_traits.R index c8c1f06..aac8665 100644 --- a/R/ppo_traits.R +++ b/R/ppo_traits.R @@ -26,7 +26,7 @@ ppo_traits <- function(x, sorted = TRUE, flatten_traits = TRUE, flatten_all = FA out <- lapply(gsub("^.*/([0-9]*)$", "\\1", x$data$eventId[1:2]), function(id){ x <- jsonlite::read_json( paste0( - "http://www.usanpn.org/npn_portal/observations/getObservationById.json?request_src=PPO&observation_id=", + "http://services.usanpn.org/npn_portal/observations/getObservationById.json?request_src=PPO&observation_id=", id), simplifyVector = T ) if (sorted) diff --git a/README.md b/README.md index 0250e80..1f051a4 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,7 @@ started with rppo. We recommend visiting the [rppo vignette](https://htmlpreview.github.io/?https://github.com/ropensci/rppo/blob/master/vignettes/rppo-vignette.html) for a more complete set of examples on using the rppo package, as well as viewing man pages for rppo functions in the R environment, using -`?ppo_data` and -`?ppo_terms`. +`?ppo_data` and `?ppo_terms`. ``` r # query all results from day 1 through 100 in a particular bounding box,