From a0943915c43a2ce4d776a40b77be197cb73c930a Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Thu, 28 May 2015 23:25:05 -0700 Subject: [PATCH 1/1] removed code that is only useful for producing the sweave file for the paper --- 05-generate_spells.R | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/05-generate_spells.R b/05-generate_spells.R index 8356273..cfbbd79 100644 --- a/05-generate_spells.R +++ b/05-generate_spells.R @@ -319,6 +319,8 @@ r[["num.dropped.level.nomatch"]] <- nrow(tmp) # as a result, we can simply drop these form the final state # an alternate approach would be to set these to NA as in: # spells[tmp, level := as.character(NA), mult="last"] + + final.state <- final.state[!tmp,] # now, we have to take the list of open spells and find the subset of the final @@ -341,20 +343,3 @@ setkey(spells, title) save(spells, file="spells.RData") -# save several other computationally intensive datasets - -# load page info data -page.metadata.filename <- "enwiki-20150112-page.csv" -page.info <- fread(page.metadata.filename, - header=FALSE, stringsAsFactors=FALSE, na.strings=NULL, - select=1:3, showProgress=TRUE) - -setnames(page.info, c("page.id", "ns.num", "title")) - -r[["num.pages"]] <- nrow(page.info) -r[["num.pages.main"]] <- table(page.info$ns.num)[["0"]] - -## save and go home -########################################################## -save(r, file="sweave_data_spellgen.RData") - -- 2.39.5