wt_data: Wikidata taxonomy data

Description Usage Arguments Details Value Examples

View source: R/wiki.R

Description

Wikidata taxonomy data

Usage

1
2
3
wt_data(x, property = NULL, ...)

wt_data_id(x, language = "en", limit = 10, ...)

Arguments

x

(character) a taxonomic name

property

(character) a property id, e.g., P486

...

curl options passed on to httr::GET()

language

(character) two letter language code

limit

(integer) records to return. Default: 10

Details

Note that wt_data can take a while to run since when fetching claims it has to do so one at a time for each claim

You can search things other than taxonomic names with wt_data if you like

Value

wt_data searches Wikidata, and returns a list with elements:

wt_data_id gets the Wikidata ID for the searched term, and returns the ID as character

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# search by taxon name
# wt_data("Mimulus alsinoides")

# choose which properties to return
wt_data(x="Mimulus foliatus", property = c("P846", "P815"))

# get a taxonomic identifier
wt_data_id("Mimulus foliatus")
# the id can be passed directly to wt_data()
# wt_data(wt_data_id("Mimulus foliatus"))

## End(Not run)

wikitaxa documentation built on July 2, 2020, 12:58 a.m.