data_raw/names/races/000-parse.r

root = "~/dev/gmhelper/"
data_root = paste0(root, "/data/")
setwd(paste0(root, "/data_raw/data/names/races"))

reader = function(f) read.csv(f, sep="\t", header=TRUE, stringsAsFactors=FALSE)

files = dir(pattern="*.csv")
names_names = sapply(strsplit(files, split=".", fixed=TRUE), `[`, 1)

gmh_racenames = lapply(files, reader)
names(gmh_racenames) = names_names # lel

outfile = paste0(data_root, "gmh_racenames.rda")
save(file=outfile, gmh_racenames)
wrathematics/gmhelper documentation built on May 4, 2019, 9:49 a.m.