Skip to content

Instantly share code, notes, and snippets.

View gpleiss's full-sized avatar

Geoff Pleiss gpleiss

View GitHub Profile
@justgrimes
justgrimes / gist:3308085
Created August 9, 2012 21:07
text mining in r snippet
require(tm)
a <- Corpus(DirSource("C:/Users/jgrimes/Desktop/text/"), readerControl = list(language="lat"))
#summary(a)
a <- tm_map(a, function(x) iconv(enc2utf8(x), sub = "byte"))
a <- tm_map(a, removePunctuation)
a <- tm_map(a, removeNumbers)
a <- tm_map(a, stripWhitespace)
a <- tm_map(a, tolower)
a <- tm_map(a, removeWords, stopwords("english"))
a <- tm_map(a, stemDocument, language = "english")
@lynaghk
lynaghk / gist:1062939
Created July 4, 2011 05:28
R + Sqlite example
# Run this first:
#
# install.packages(c('RSQLite.extfuns', 'ggplot2', 'maps'))
#
library(RSQLite)
library(ggplot2)
library(RSQLite.extfuns)
db = dbConnect(
dbDriver("SQLite")