Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterprovoost committed Oct 11, 2019
1 parent ce17363 commit 5910f3c
Show file tree
Hide file tree
Showing 39 changed files with 2,314 additions and 1,641 deletions.
7 changes: 4 additions & 3 deletions DESCRIPTION
@@ -1,8 +1,8 @@
Package: robis
Title: Ocean Biogeographic Information System (OBIS) Client
Description: Client for the Ocean Biogeographic Information System (<https://obis.org>).
Version: 2.1.13
Date: 2019-10-10
Version: 2.2.1
Date: 2019-10-11
Authors@R: c(
person("Pieter", "Provoost", , "pieterprovoost@gmail.com", c("cre", "aut")),
person("Samuel", "Bosch", , "mail@samuelbosch.com", role = "aut"),
Expand All @@ -18,7 +18,8 @@ Imports:
dplyr,
jsonlite,
leaflet,
ggplot2
ggplot2,
tidyr
License: MIT + file LICENSE
Suggests:
testthat
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE 100755 → 100644
Expand Up @@ -5,10 +5,12 @@ export(checklist)
export(dataset)
export(map_ggplot)
export(map_leaflet)
export(measurements)
export(node)
export(occurrence)
import(dplyr)
import(ggplot2)
import(httr)
import(jsonlite)
import(leaflet)
import(tidyr)
19 changes: 19 additions & 0 deletions R/mof.R
@@ -0,0 +1,19 @@
#' Extract measurements or facts from occurrence data with a mof column.
#'
#' @usage measurements(df, fields = c("id"))
#' @param df the occurrence dataframe.
#' @param fields columns from the occurrence dataframe to include.
#' @return The measurements.
#' @export
measurements <- function(df, fields = c("id")) {
if ("id" %in% names(df) & "mof" %in% names(df)) {
if (class(df$mof) == "list") {
return(unnest(df %>% select(c(fields, "mof")), cols = "mof"))
} else {
return(data.frame())
}
} else {
warning("Missing columns id or mof")
return(NULL)
}
}
28 changes: 26 additions & 2 deletions R/occurrence.R
Expand Up @@ -2,7 +2,10 @@
#'
#' @usage occurrence(scientificname = NULL, taxonid = NULL, datasetid = NULL,
#' nodeid = NULL, areaid = NULL, startdate = NULL, enddate = NULL,
#' startdepth = NULL, enddepth = NULL, geometry = NULL, redlist = NULL,
#' startdepth = NULL, enddepth = NULL,
#' measurementtype = NULL, measurementtypeid = NULL, measurementvalue = NULL,
#' measurementvalueid = NULL, measurementunit = NULL, measurementunitid = NULL,
#' geometry = NULL, redlist = NULL, mof = FALSE,
#' hab = NULL, exclude = NULL, fields = NULL, verbose = FALSE)
#' @param scientificname the scientific name.
#' @param taxonid the taxon identifier (WoRMS AphiaID).
Expand All @@ -13,9 +16,16 @@
#' @param enddate the latest date on which the occurrence took place.
#' @param startdepth the minimum depth below the sea surface.
#' @param enddepth the maximum depth below the sea surface.
#' @param measurementtype the measurement type to be included in the measurements data.
#' @param measurementtypeid the measurement type ID to be included in the measurements data.
#' @param measurementvalue the measurement value to be included in the measurements data.
#' @param measurementvalueid the measurement value ID to be included in the measurements data.
#' @param measurementunit the measurement unit to be included in the measurements data.
#' @param measurementunitid the measurement unit ID to be included in the measurements data.
#' @param geometry a WKT geometry string.
#' @param redlist include only IUCN Red List species.
#' @param hab include only IOC-UNESCO HAB species.
#' @param mof include measurements data (default = \code{FALSE}).
#' @param exclude quality flags to be excluded from the results.
#' @param fields fields to be included in the results.
#' @param verbose logical. Optional parameter to enable verbose logging (default = \code{FALSE}).
Expand All @@ -36,11 +46,18 @@ occurrence <- function(
startdepth = NULL,
enddepth = NULL,
geometry = NULL,
measurementtype = NULL,
measurementtypeid = NULL,
measurementvalue = NULL,
measurementvalueid = NULL,
measurementunit = NULL,
measurementunitid = NULL,
redlist = NULL,
hab = NULL,
exclude = NULL,
fields = NULL,
verbose = FALSE
verbose = FALSE,
mof = FALSE
) {

after <- "-1"
Expand All @@ -60,8 +77,15 @@ occurrence <- function(
startdepth = startdepth,
enddepth = enddepth,
geometry = geometry,
measurementtype = measurementtype,
measurementtypeid = measurementtypeid,
measurementvalue = measurementvalue,
measurementvalueid = measurementvalueid,
measurementunit = measurementunit,
measurementunitid = measurementunitid,
redlist = handle_logical(redlist),
hab = handle_logical(hab),
mof = handle_logical(mof),
exclude = handle_vector(exclude),
fields = handle_fields(fields)
)
Expand Down
2 changes: 1 addition & 1 deletion R/robis.R
Expand Up @@ -4,5 +4,5 @@
#'
#' @docType package
#' @name robis
#' @import dplyr httr jsonlite leaflet ggplot2
#' @import dplyr httr jsonlite leaflet ggplot2 tidyr
NULL
135 changes: 135 additions & 0 deletions docs/404.html

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

137 changes: 137 additions & 0 deletions docs/LICENSE-text.html

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

0 comments on commit 5910f3c

Please sign in to comment.