Learn R Programming

birdnik (version 0.1.1)

word_top_example: Retrieve a Word's Top Example

Description

word_top_example grabs, as it suggests, the top example for each entry in words.

Usage

word_top_example(key, words, use_canonical = FALSE, ...)

Arguments

key

a Wordnik API key. These can be obtained at the Wordnik developer portal.

words

a vector of words.

use_canonical

whether to use the stemmed, canonical form of the word (i.e. 'cat', for 'cats') instead of the actual word. FALSE by default. Note that for pronunciations specifically, setting it to TRUE may get a wider range of pronunciations; you should experiment.

...

further arguments to pass to httr's GET.

Value

a data.frame of 5 columns; provider, year, rating, word and example.

Examples

Run this code
# NOT RUN {
examples <- word_top_example(key = "madeupkey", words = c("cat", "dog", "turnip"))
# }

Run the code above in your browser using DataLab