check_assertions: Check assertions in occurrences object

Description Usage Arguments Value References Examples

View source: R/check_assertions.R

Description

This provides a data.frame detailing the assertions that are found in a dataset returned from occurrences.

Usage

1

Arguments

x

list: an object returned from occurrences

Value

A dataframe of assertions column names, descriptions and categories/error codes. If no assertions are in the dataset, NULL is returned.

References

https://api.ala.org.au/, https://biocache-ws.ala.org.au/ws/assertions/codes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
 ##download species data with all possible assertions

 x <- occurrences(taxon="golden bowerbird", download_reason_id=10,
 qa=ala_fields("assertions")$name)

 asserts <- check_assertions(x)
 ## this is a data.frame of assertions, their description and column names

 ## list the descriptions of all (current) assertions
 asserts$description

 ## assertion columns from data
 tmp <- x$data[, names(x$data) %in% asserts$name]
 which(colSums(tmp) > 0) ## discard those not seen in the data

## End(Not run)

ALA4R documentation built on July 12, 2021, 9:07 a.m.