prepare_gtd: Prepare the GTD data

Description Usage Arguments Value Examples

View source: R/prepare_data.r

Description

Creates a document term matrix in the dfm class. Includes only the meta data used for the analysis presented in the vignette.

Usage

1
prepare_gtd(d, fromdate = NULL, todate = NULL, rm_time = T)

Arguments

d

A data.frame with the GTD data. You can download the GTD data for free by filling out this form. You can read the .xlsx file with read.xlsx.

fromdate

A Date (or character value that can be coerced to Date)

todate

A Date (or character value that can be coerced to Date)

rm_time

If TRUE, remove time related terms, such as monday, januari and yesterday.

Value

A quanteda style DTM

Examples

1
2
gtd_data = openxlsx::read.xlsx('GTD FILE AS DOWNLOADED FROM GTD WEBSITE')
gtd_dtm = prepare_gtd(gtd_data, fromdate='2010-01-01')

maskedforreview/gtdnews documentation built on April 12, 2021, 11:53 a.m.