knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

CRAN Version Downloads Travis-CI Build Status Appveyor Build status codecov.io

LIWCalike: an R implementation of the Linguistic Inquiry and Word Count

Built on the quanteda package for text analysis, LIWCalikes provides a simple interface to the analysis of text by counting words and other textual features, including the application of a dictionary to produce a tabular report of percentages. This provides similar functionality to the LIWC stand-alone software.

The user must supply a dictionary, which can include one of the custom LIWC dictionaries if these have been purchased from http://liwc.wpengine.com, or any other dictionary supplied by the user. The dictionary() constructor of the quanteda package, on which LIWCalike is built, can read both LIWC and Wordstat-formatted dictionary files, or you can use it to create a dictionary from an R list object (a named list of character vectors, where each character vector is a set of dictionary match patterns and its associated name is the dictionary key).

Differences from the LIWC standalone software

This package is designed for R users and those wishing to build functionality by extending the quanteda package for text analysis. If you prefer to have a complete, stand-alone user interface, then you should purchase and use the LIWC standalone software. This has several advantages:

Using dictionaries with LIWCalike

No dictionaries are supplied with LIWCalike, it is up to you to supply these. With the quanteda functions for creating or importing dictionaries, however, this is quite easy.

With the LIWC 2007, external dictionaries were distributed with the software that could be used in the format read by Provalis Research's Wordstat. Because I purchases a license for this product, I have that file and can use it with LIWCalike.

Using it is quite straightforward:

library("LIWCalike")
library("quanteda")

# read in the dictionary
liwc2007dict <- dictionary(file = "~/Dropbox/QUANTESS/dictionaries/LIWC/LIWC2007.cat", 
                           format = "wordstat")
tail(liwc2007dict, 1)

# our test data
data_char_testphrases

# call LIWCalike
output <- liwcalike(data_char_testphrases, liwc2007dict)

# view some results
output[, c(1:7, ncol(output)-2)]

How to Install

LIWCalike is currently only available on GitHub, not on CRAN. The best method of installing it is through the devtools package:

devtools::install_github("kbenoit/LIWCalike")

This will also automatically install the quanteda package on which LIWCalike is built.

Comments, feedback, and code of conduct

I welcome your comments and feedback. Please file issues on the issues page, and/or send me comments at kbenoit@lse.ac.uk.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.



kbenoit/LIWCalike documentation built on May 20, 2019, 7:54 a.m.