taxinfo_download {ALA4R}R Documentation

Download taxonomic data

Description

Download taxonomic data

Usage

taxinfo_download(query, fq, fields, verbose = ala_config()$verbose,
  use_data_table = TRUE)

Arguments

query

string: (optional) query of the form field:value (e.g. "genus:Macropus") or a free text search ("Alaba vibex")

fq

string: character string or vector of strings, specifying filters to be applied to the original query. These are of the form "INDEXEDFIELD:VALUE" e.g. "kingdom:Fungi". See ala_fields("general") for all the fields that are queryable. NOTE that fq matches are case-sensitive, but sometimes the entries in the fields are not consistent in terms of case (e.g. kingdom names "Fungi" and "Plantae" but "ANIMALIA"). fq matches are ANDed by default (e.g. c("field1:abc","field2:def") will match records that have field1 value "abc" and field2 value "def"). To obtain OR behaviour, use the form c("field1:abc OR field2:def")

fields

string vector: (optional) a vector of field names to return. Note that the columns of the returned data frame are not guaranteed to retain the ordering of the field names given here. If not specified, a default list of fields will be returned. See ala_fields("general") for valid field names

verbose

logical: show additional progress information? [default is set by ala_config()]

use_data_table

logical: if TRUE, attempt to read the data.csv file using the fread function from the data.table package. Requires data.table to be available. If this fails, or use_data_table is FALSE, then read.table will be used (which may be slower)

Value

data frame of results, containing one row per taxon, typically with name, guid, and taxonomic information. The columns returned will depend on the field requested

Author(s)

Atlas of Living Australia support@ala.org.au

References

http://api.ala.org.au/

See Also

ala_fields, ala_config

Examples

## Not run: 
# Download data for Fabaceae
x=taxinfo_download("family:Fabaceae",fields=c("guid","parentGuid","kingdom","phylum","class","bioOrder","family","genus","nameComplete"))
## note that requesting "nameComplete" gives the scientific name but requesting "scientificName" will not --- bug to be fixed in ALA's web service
# equivalent direct URL: http://bie.ala.org.au/ws/download?fields=guid,parentGuid,kingdom,phylum,class,bioOrder,family,genus,nameComplete&q=family:Fabaceae

## End(Not run)

[Package ALA4R version 1.01 Index]