search_coha: Search the Corpus of Historical American English (COHA)

Description Usage Arguments Value Examples

View source: R/search_coha.R

Description

Retrieve keyword-in-context results from the COHA.

Usage

1
2
search_coha(search_terms, section = "fict", max_type = 10,
  max_per_term = 100, max_total_result = 1000)

Arguments

search_terms

The search term or terms, as a vector of strings.

section

The section or sections of the COHA to search in, from among "all" for all sections, "fict" for the fiction section (the default), "mag" for magazine, "news" for newspaper, "nf" for NF Books. Also, a specific decade can be specified by the first year in the decade, for example, 1920 or 1880. Any combination of genres and/or decades can be specified in a vector, for example, section = c("1850", "1950") or section = c("mag", "news").

max_type

An integer specifying the maximum number of unique word types to return for each search string (results shown in the upper right portion of the COHA). For example, searching for nouns with the search string "[n*]" could potentially return tens of thousands of unique types, but the user may only be interested in the 100 most frequent ones.

max_per_term

An integer specifying the maximum number of keyword-in-context (KWIC) results to return for each search string.

max_total_result

An integer specifying the maximum number of total results to return. If only one search term is given in search_terms, this argument should be equal to or greater than the integer specified in max_per_term.

Value

A data frame.

Examples

1
2
3
search_coha("erstwhile")
search_coha("erstwhile", section = "mag")
search_coha(c("erstwhile", "ere"), section = c("mag", "news"), max_per_term = 500)

ekbrown/byucorpora documentation built on Oct. 24, 2019, 9:27 p.m.