write_search: Write Boolean searches

Description Usage Arguments Value Examples

Description

Takes search terms grouped by concept group and writes Boolean searches in which terms within concept groups are separated by "OR" and concept groups are separated by "AND". Searches can be written in up to 53 languages, though the function defaults to only searching the top ten most used languages in a discipline using the choose_languages() function. The default for language options relies on searching a database of journals by discipline based on Ulrich's Periodicals Directory. Only scientific fields are included in this database. All supported languages can be seen with available_languages().

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
write_search(
  groupdata,
  API_key = NULL,
  languages = NULL,
  exactphrase = FALSE,
  stemming = TRUE,
  closure = c("left", "right", "full", "none"),
  directory = "./",
  writesearch = FALSE,
  verbose = TRUE
)

Arguments

groupdata

a list of character vectors, each of which is a concept group

API_key

your Google Translate API key

languages

a character vector of supported languages to write searches in.

exactphrase

if set to TRUE, stemmed search terms with multiple words will be enclosed in quotes

stemming

if TRUE, writes stemmed search (only when the current language is English)

closure

restrictions on how keywords are detected; left requires terms to start with a keyword (e.g "burn" matches "burning"), right requires terms to end with a keyword (e.g. "burn" matches "postburn" but not "postburning"), full requires exact matches (e.g. "burn" only matches "burn"), and none allows keywords to be embedded within terms.

directory

the path to the directory where you want to save searches (defaults to current working directory)

writesearch

if TRUE, saves the searches to .txt files in the specified directory

verbose

if TRUE, prints when each language is finished writing

Value

a list of search strings

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
write_search(
  groupdata = list(
    c("black-backed woodpecker", "picoides arcticus"),
    c("post-fire forest", "time since fire")
  ),
  languages = "English",
  exactphrase = TRUE,
  stemming = TRUE,
  closure = "left",
  writesearch = FALSE,
  verbose = FALSE
)

elizagrames/litsearchr documentation built on April 14, 2021, 3:42 p.m.