mi_analyze_document: Run a one or more documents through a misinformation/bias...

Description Usage Arguments Value Examples

Description

Run a one or more documents through a misinformation/bias sentiment analysis

Usage

1
mi_analyze_document(path = ".", pattern = NULL, bias_type, sentiment_list)

Arguments

path

a character vector of full path names; the default corresponds to the working directory, getwd(). Tilde expansion (see 'path.expand“) is performed. Missing values will be ignored.

pattern

an optional regular expression. Only file names which match the regular expression will be returned. (e.g. ".*\.txt$)

bias_type

a one-word (no punctuation or spaces) description of the bias type of the sentiment list being used. This will be used to tag the output so it can be used later when aggregating results of multiple bias-type analyses.

sentiment_list

a character vector of words/phrases. The built-in sentiment bias lists can be used via mi_use_builtin() or the caller can pass in a charcter vector of lower-case words/phrases

Value

a list (classed as misinfo_corpus) with:

Examples

1
2
3
4
5
6
mi_analyze_document(
  system.file("extdat", package="misinfo"),
  pattern=".*txt$",
  bias_type = "explanatory",
  sentiment_list = mi_use_builtin("explanatory")
)

hrbrmstr/misinfo documentation built on May 7, 2019, 9:36 a.m.