Commit 99615c00 authored by Sebastian Baltes's avatar Sebastian Baltes
Browse files

Check sample for journal extensions

parent 8ddee5fc
......@@ -10,6 +10,7 @@ setwd(dir)
library(data.table)
library(random)
library(hashmap)
PAPERS_PER_VENUE <- 5
......@@ -46,3 +47,36 @@ nrow(sample)
sample <- sample[randomSequence(min=1, max=nrow(sample), col=1, check=TRUE)[,1]]
write.table(sample, file="../output/sample.csv", sep=",", col.names=TRUE, row.names=FALSE, na="", quote=TRUE, qmethod="double", fileEncoding="UTF-8")
########################################
# read sample
sample <- fread("../output/sample.csv", header=TRUE, sep=",", quote="\"", strip.white=TRUE, showProgress=TRUE, encoding="UTF-8", na.strings=c("", "null"), stringsAsFactors=FALSE)
nrow(sample)
# 100
# check for journal extensions of conference papers (same authors)
authors_papers <- hashmap(character(), character())
for (i in 1:nrow(sample)) {
authors <- strsplit(sample[i]$authors, ";")
authors <- unlist(lapply(authors, trimws))
authors <- paste(authors[order(authors)], collapse="; ")
if (is.na(authors_papers$find(authors))) {
authors_papers$insert(authors, sample[i]$title)
} else {
authors_papers$insert(authors, paste(authors_papers$find(authors), sample[i]$title, sep=";"))
}
}
length(authors_papers$keys())
# 100
for (authors in authors_papers$keys()) {
papers <- unlist(strsplit(authors_papers$find(authors), ";"))
if (length(papers) > 1) {
print(paste0("Authors: ", authors))
print(paste0("Papers: ", paste(papers, collapse="; ")))
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment