Showing posts with label text analysis. Show all posts
Showing posts with label text analysis. Show all posts

Wednesday, April 27, 2022

Processing the sugar map

 Different implementations of the Sugarscpe agent-based model have different ways to get up the sugar map. SugarscapeCW used a built-in matrix (no space between each number) whereas the NetLogo model library uses an external text file with a blank space between each number. 

The easy way to translate between these two different format is to use the readr R package, something like this:

library(readr)

sugar_map1 <- read_fwf("~/tmp/sugar-map1.txt", fwf_widths(c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1), col_names = NULL))

write_delim(sugar_map1, "~/tmp/sugar-map-out.txt", delim = " ", col_names = FALSE)

Saturday, September 30, 2017

Tidytext + stm

The new version of tidytext package now works with the stm package for topic modeling. This is a great new development.

Saturday, November 05, 2016

Sunday, February 21, 2016

Another text analysis package

Quanteda seems to be a serious contender for analyzing textual data using R.

Counter