Skip to content

Instantly share code, notes, and snippets.

View kbenoit's full-sized avatar

Kenneth Benoit kbenoit

View GitHub Profile
@kbenoit
kbenoit / read_liwc2015_dictionary.R
Last active February 15, 2023 10:10
Create a quanteda dictionary from the LIWC dictionary poster pdf
# you need Xpdf for this: https://www.xpdfreader.com/download.html
# and the current working directory should be the location of the file
#
# also requires quanteda and stringi
#' Create a dictionary from a LIWC dictionary poster pdf
#'
#' Creates a \pkg{quanteda} dictionary from a LIWC dictionary output from the
#' LIWC software as a "dictionary poster" pdf. Currently tested with LIWC 2015
#' v1.5.0, available for purchase from \url{http://http://liwc.wpengine.com/}.
@kbenoit
kbenoit / text_as_data_an_overview.R
Created March 21, 2019 06:45
Analysis from Text as Data: An Overview
library(quanteda)
## Package version: 1.4.3
## Parallel computing: 2 of 12 threads used.
## See https://quanteda.io for tutorials and examples.
##
## Attaching package: 'quanteda'
## The following object is masked from 'package:utils':
##
## View
@kbenoit
kbenoit / compare_kind.R
Created March 11, 2019 05:09
Examples of polysemy for "kind" in the State of the Union corpus
library("quanteda")
## Package version: 1.4.2
## Parallel computing: 2 of 12 threads used.
## See https://quanteda.io for tutorials and examples.
##
## Attaching package: 'quanteda'
## The following object is masked from 'package:utils':
##
## View
library("spacyr")