Skip to content

Instantly share code, notes, and snippets.

Avatar

Sean Norton stnorton

View GitHub Profile
@stnorton
stnorton / R2MALLET.r
Created Nov 14, 2019 — forked from benmarwick/R2MALLET.r
R code to operate MALLET entirely from within R. Set variables, send commands to Windows' command console and get MALLET's result back into R for further analysis.
View R2MALLET.r
# Set working directory
dir <- "C:\\" # adjust to suit
setwd(dir)
# configure variables and filenames for MALLET
## here using MALLET's built-in example data and
## variables from http://programminghistorian.org/lessons/topic-modeling-and-mallet
# folder containing txt files for MALLET to work on
importdir <- "C:\\mallet-2.0.7\\sample-data\\web\\en"