Skip to content

Commit

Permalink
fix for dataset()
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterprovoost committed May 30, 2019
1 parent 35fb047 commit 1539387
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions CRAN-RELEASE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This package was submitted to CRAN on 2019-02-26.
Once it is accepted, delete this file and tag the release (commit 79c85adffe).
This package was submitted to CRAN on 2019-05-29.
Once it is accepted, delete this file and tag the release (commit 35fb047f79).
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: robis
Title: Ocean Biogeographic Information System (OBIS) Client
Description: Client for the Ocean Biogeographic Information System (<https://obis.org>).
Version: 2.1.5
Version: 2.1.6
Date: 2019-05-29
Authors@R: c(
person("Pieter", "Provoost", , "pieterprovoost@gmail.com", c("cre", "aut")),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# robis 2.1.6

Fix for `dataset()`.

# robis 2.1.5

Added `exclude` and `fields` parameters, added EPSG:3031 support for Leaflet maps.
Expand Down
2 changes: 1 addition & 1 deletion R/checklist.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @usage checklist(scientificname = NULL, taxonid = NULL, datasetid = NULL,
#' nodeid = NULL, areaid = NULL, startdate = NULL, enddate = NULL,
#' startdepth = NULL, enddepth = NULL, geometry = NULL, redlist = NULL,
#' verbose = FALSE)
#' exclude = NULL, verbose = FALSE)
#' @param scientificname the scientific name.
#' @param taxonid the taxon identifier (WoRMS AphiaID).
#' @param datasetid the dataset identifier.
Expand Down
6 changes: 3 additions & 3 deletions R/dataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @usage dataset(scientificname = NULL, taxonid = NULL, datasetid = NULL,
#' nodeid = NULL, areaid = NULL, startdate = NULL, enddate = NULL,
#' startdepth = NULL, enddepth = NULL, geometry = NULL, redlist = NULL,
#' verbose = FALSE)
#' exclude = NULL, verbose = FALSE)
#' @param scientificname the scientific name.
#' @param taxonid the taxon identifier (WoRMS AphiaID).
#' @param datasetid the dataset identifier.
Expand Down Expand Up @@ -78,8 +78,8 @@ dataset <- function(
skip <- skip + page_size()

if (!is.null(res$results) && is.data.frame(res$results) && nrow(res$results) > 0) {
res$results$node_id <- apply(res$results$node, 1, function(x) { return(x["id"]) })
res$results$node_name <- apply(res$results$node, 1, function(x) { return(x["name"]) })
res$results$node_id <- sapply(res$results$nodes, function(x) { return(paste0(x$id, collapse = ",")) })
res$results$node_name <- sapply(res$results$nodes, function(x) { return(paste0(x$name, collapse = ",")) })
res$results <- res$results[,!(names(res$results) %in% c("node", "feed", "institutes", "contacts"))]
result_list[[i]] <- res$results
fetched <- fetched + nrow(res$results)
Expand Down
5 changes: 3 additions & 2 deletions R/map.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
#' @param popup function generating the popup content.
#' @param antarctic use antarctic polar stereographic projection.
#' @export
map_leaflet <- function(data, color = "#ff3399", provider_tiles = "OpenStreetMap.BlackAndWhite", popup = function(x) { x["id"] }, antarctic = FALSE) {
map_leaflet <- function(data, color = "#ff3399", provider_tiles = "OpenStreetMap.BlackAndWhite",
popup = function(x) { x["id"] }, antarctic = FALSE) {
p <- NULL
if (!is.null(popup)) {
p <- apply(data, 1, popup)
Expand All @@ -26,7 +27,7 @@ map_leaflet <- function(data, color = "#ff3399", provider_tiles = "OpenStreetMap
origin = c(-extent, extent),
bounds = list( c(-extent, -extent), c(extent, extent) )
)
m <- leaflet(occ, options = leafletOptions(crs = crsAntartica, minZoom = 0, maxZoom = 16)) %>%
m <- leaflet(data, options = leafletOptions(crs = crsAntartica, minZoom = 0, maxZoom = 16)) %>%
setView(0, -90, 0) %>%
addTiles(
urlTemplate = "https://tile.gbif.org/3031/omt/{z}/{x}/{y}@1x.png?style=gbif-light",
Expand Down
2 changes: 1 addition & 1 deletion man/checklist.Rd

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

2 changes: 1 addition & 1 deletion man/dataset.Rd

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

0 comments on commit 1539387

Please sign in to comment.