kwm: Produce a model object based on regular expressions.

Description Usage Arguments Value

Description

Produce a model object based on regular expressions.

Usage

1
2
3
4
5
6
kwm(include = character(), exclude = character(), varname,
  search_fun = stringr::regex, search_opts = NULL)

## S3 method for class 'kwm'
predict(object, newdata, progress = interactive(),
  return_names = FALSE, parallel = TRUE, ...)

Arguments

include

Character. List of regular expression patterns, any one of which will return a positive match.

exclude

Character. List of regular expression patterns, any one of which will return a negative match, overriding any other matches with include

varname

Character. A character vector of length one with the column name to be tested.

search_fun

One of the stringr::modifiers functions from stringr::stringr. Defaults to stringr::regex.

search_opts

List of arguments to pass to search_fun.

object

A kwm model object

newdata

A data.frame containing a text column

progress

Logical. Display a progress bar?

return_names

Logical. Add original text as names to the resulting logical vector? Defaults to false.

parallel

Logical. Compute predictions in parallel? Requires doParallel.

...

Other arguments passed from functions. Not used currently.

Value

kwm returns a model object of class kwm

predict.kwm reutrns a logical vector.


mdlincoln/kwm documentation built on May 14, 2019, 2:15 p.m.