search_coca: Search the Corpus of Contemporary American English (COCA)

Description Usage Arguments Value Examples

View source: R/search_coca.R

Description

Retrieve keyword-in-context results from the COCA.

Usage

1
2
search_coca(search_terms, section = "spok", 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 of the COCA to search in, from among "all" for all sections (the default), "spok" for the spoken section, "fict" for fiction, "mag" for magazine, "news" for newspaper, "acad" for academic.

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 COCA). 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_coca("hello")
search_coca("dude", section = "spok")
search_coca(c("dude", "gnarly"), section = "spok", max_per_term = 500)

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