search_quotes {statquotes} | R Documentation |
Search the quote database for a string or regex pattern
Description
This function takes a search pattern (or regular expression) and returns all quotes that match the pattern.
A convenient wrapper for search quotes that by default returns all quotes
Usage
search_quotes(
search,
ignore_case = TRUE,
fuzzy = FALSE,
fields = c("text", "source", "tags", "cite"),
...
)
search_text(search, fuzzy = FALSE, ...)
get_quotes(search = ".*", ...)
Arguments
search |
A character string or regex pattern to search the database. |
ignore_case |
If |
fuzzy |
If |
fields |
A character vector of the particular fields to search.
The default is |
... |
additional arguments passed to |
Value
A data frame (also with class 'statquote'
) object containing all quotes that match the search parameters.
A data frame (also with class 'statquote'
) object
containing all quotes.
See Also
Examples
search_quotes("^D") # regex to find all quotes that start with "D"
search_quotes("Tukey") # all quotes with "Tukey"
search_quotes("Turkey", fuzzy = TRUE) # fuzzy match
# to a data.frame
out <- search_quotes("bad data", fuzzy = TRUE)
as.data.frame(out)
search_text("omnibus")
qdb <- get_quotes()
nrow(qdb)
names(qdb)