R/worms_common.R

Defines functions worms_common

Documented in worms_common

#' Common names from WoRMS ID
#'
#' @export
#' @template worms_id
#' @examples \dontrun{
#' worms_common(ids=1080)
#' worms_common(ids=22388)
#' worms_common(ids=123080)
#' worms_common(ids=160281)
#' worms_common(ids=c(1080,22388,160281,123080,22388))
#' }
worms_common <- function(ids=NULL, opts=NULL, iface=NULL, ...) {
  server <- 'http://www.marinespecies.org/aphia.php?p=soap'
  if (!is.null(iface)) worms_iface <- iface
  fxn <- worms_get_fxn('getAphiaVernacularsByID')
  res <- lapply(ids, fxn, server = server, .opts = opts, .convert = FALSE)
  do.call("rbind.fill", Map(worms_parse_xml, res, aphiaid = ids))
}
ropensci/taxizesoap documentation built on May 18, 2022, 7:33 p.m.