This provides a data.frame detailing the assertions that are found in a dataset returned from occurrences
.
check_assertions(x)
x | list: an object returned from |
---|
A dataframe of assertions column names, descriptions and categories/error codes. If no assertions are in the dataset, NULL is returned.
https://api.biodiversitydata.se/, http://records.biodiversitydata.se/ws/assertions/codes
#download species data with all possible assertions if (FALSE) { x <- occurrences(taxon="golden plover", download_reason_id=10, qa=sbdi_fields("assertions")$name) asserts <- check_assertions(x) #data.frame of assertions, their description and column names asserts$description # List out descriptions of all (current) assertions tmp <- x$data[,names(x$data) %in% asserts$name] ## assertion columns from data which(colSums(tmp)>0) ## discard those not seen in the data }