Skip to content

Instantly share code, notes, and snippets.

View whalejasmine's full-sized avatar
🎯
Focusing

whalejasmine whalejasmine

🎯
Focusing
View GitHub Profile
@whalejasmine
whalejasmine / PDF-2-text-or-CSV.r
Created January 27, 2017 16:21 — forked from benmarwick/PDF-2-text-or-CSV.r
Convert PDFs to text files or CSV files (DfR format) with R
# Here are a few methods for getting text from PDF files. Do read through
# the instructions carefully! NOte that this code is written for Windows 7,
# slight adjustments may be needed for other OSs
# Tell R what folder contains your 1000s of PDFs
dest <- "G:/somehere/with/many/PDFs"
# make a vector of PDF file names
myfiles <- list.files(path = dest, pattern = "pdf", full.names = TRUE)
require(ggplot2)
require(gridExtra)
require(reshape2)
set.seed(1)
predictors = data.frame(x1 = rnorm(1000, mean = 5, sd = 2),
x2 = rexp(1000, rate=10))
p1 = ggplot(predictors) + geom_point(aes(x = x1, y = x2))