vignettes/search_and_screening.Rmd
search_and_screening.Rmd
Naive search: TS=((“picoides borealis” OR “red-cockaded woodpecker*" OR “red cockaded woodpecker” OR “leuconotopicus borealis” OR woodpecker) AND (“prescribed burn*" OR “prescribed fire" OR fire OR wildfire* OR burn) AND (abundan OR presen* OR occup* OR occur* OR (popul* NEAR/2 (densit* OR size))))
Searches were conducted on April 10, 2019 with no date restrictions. We searched Scopus (1970-2019) and five databases in Web of Science: the Web of Science Core Collection (1900-2019), BIOSIS Previews (1926-2019), Current Contents Connect (1998-2019), MEDLINE (1950-2019), and Zoological Record (1945-2019).
search_directory <- "~/litsearchr/inst/extdata/borealis/"
naiveimport <- litsearchr::import_results(directory = search_directory, remove_duplicates = FALSE, clean_dataset = TRUE, save_full_dataset = FALSE)
dedupe_stage1 <- litsearchr::deduplicate(naiveimport, use_abstracts = FALSE, use_titles = TRUE, method = "quick")
dedupe_stage2 <- litsearchr::deduplicate(dedupe_stage1, use_abstracts = TRUE, use_titles = FALSE, doc_sim = .8, method = "tokens")
naiveresults <- dedupe_stage2
#rakedkeywords <- litsearchr::extract_terms(naiveresults, type="RAKE", min_freq = 2, title = TRUE, abstract = TRUE, ngrams = TRUE, n=2)
# Note: if you can't run rapidraker due to rJava issues, the output is stored in litsearchr::rakedkeywords
taggedkeywords <- litsearchr::extract_terms(naiveresults, type="tagged", min_freq = 2, title = TRUE, abstract = TRUE, ngrams = TRUE, n=2)
naivedictionary <- litsearchr::make_dictionary(terms=list(rakedkeywords, taggedkeywords))
naivecorpus <- litsearchr::make_corpus(naiveresults)
naivedfm <- litsearchr::create_dfm(naivecorpus, my_dic=naivedictionary)
naivegraph <- litsearchr::create_network(naivedfm, min_studies=1, min_occurrences = 1)
plot(sort(igraph::strength(BBWO_graph)), ylab="Node strength", main="Ranked node strengths", xlab="Rank")
splinecutoff <- litsearchr::find_cutoff(naivegraph, method = "spline", degrees = 2, knot_num = 3,
diagnostics = TRUE, importance_method = "strength")
# note: if you don't want to wait for the freepsgen algorithm,
reducedgraph <- litsearchr::reduce_graph(naivegraph, cutoff_strength = splinecutoff[1])
searchterms <- litsearchr::get_keywords(reducedgraph, savekeywords = FALSE, makewordle = FALSE)
searchterms
groupedterms <- c()
for(i in 1:length(searchterms)){
print(searchterms[i])
decision <- menu(choices = c("woodpecker", "fire", "abundance", "none", "multiple"), title = "Which concept group does this term belong to?")
if(decision==1){
groupedterms[i] <- "woodpecker"}
if(decision==2){
groupedterms[i] <- "fire"
}else if(decision==3){
groupedterms[i] <- "abundance"
}else if(decision==4){
groupedterms[i] <- "x"
}else if(decision==5){
groupedterms[i] <- "multiple"
}
}
# term_groups <- cbind(searchterms, groupedterms)
term_groups <- litsearchr::term_groups
woodpeckers <- unique(append(
c("woodpecker", "red-cockaded woodpecker", "leuconotopicus borealis", "picoides borealis"),
term_groups[which(term_groups[,2]=="woodpecker"), 1]))
fire <- unique(append(
c("fire", "prescribed fire", "prescribed burn", "fire treatment"),
term_groups[which(term_groups[,2]=="fire"), 1]))
abundance <- unique(append(
c("species abundance", "species presence", "species density", "population density", "population size"),
term_groups[which(term_groups[,2]=="abundance"), 1]))
mysearchterms <- list(woodpeckers, fire, abundance)
woodpecker_search <- litsearchr::write_search(groupdata = mysearchterms,
languages = "English", stemming = TRUE,
exactphrase = TRUE, writesearch = FALSE,
verbose = TRUE)
woodpecker_search