movebank_get_vocabulary {move2}R Documentation

Retrieve information from the movebank vocabulary describing the columns

Description

Retrieve information describing the columns from the 'Movebank Attribute Dictionary'

Usage

movebank_get_vocabulary(
  labels,
  xml = "http://vocab.nerc.ac.uk/collection/MVB/current/",
  omit_deprecated = TRUE,
  return_type = c("definition", "list", "xml", "uri")
)

Arguments

labels

Either a character vector with the column names to look up or a move2 object from which the column names will be extracted. If no argument is provided all movebank terms are returned

xml

Either a connection to the movebank vocabulary xml, a path to the vocabulary file or an url where it can be downloaded. The later is the default. By downloading the xml yourself the function will speed up and become independent of an internet connection being available.

omit_deprecated

If concepts are marked deprecated they are omitted from the set of possible labels.

return_type

A character scalar identifying the desired return type, see details for more information on the specific types.

Details

This function can return data in several formats (see return_type argument):

Value

A named list of the selected return_type, note that if deprecated are not omitted duplicated names can occur.

Examples


## list of all terms used in movebank
movebank_get_vocabulary()
## Count the units used in movebank
movebank_get_vocabulary() |>
  unlist() |>
  grep(pattern = "Units:", value = TRUE) |>
  sub(replacement = "", pattern = ".*Units: ") |>
  sub(replacement = "", pattern = "; .*") |>
  table() |>
  sort()
## different return types:
movebank_get_vocabulary("light-level", return_type = "definition")
movebank_get_vocabulary("light-level", return_type = "xml")
movebank_get_vocabulary("light-level", return_type = "uri")
movebank_get_vocabulary("light-level", return_type = "list")
## get definitions of all column names of a move2 object
data <- mt_read(mt_example())
movebank_get_vocabulary(data)


[Package move2 version 0.2.7 Index]