test_package.r

library(devtools)
check()
document()
build()
install(upgrade_dependencies = FALSE)

library(dplyr)
library(stringr)
library(tidyr)
library(tidytext)
library(tidyverse)
library(broom)
library(lubridate)
library(splines)
library(ggplot2)

library(scilitlearn)
setwd('~/R/scilitlearn/')
wos = load_data('inst/extdata/sample.tsv')

## loading many files 

dir = 'tmp' 
setwd('scilitlearn')
dir()
zipfile  = 'inst/extdata/governmentality_june17.zip'
wos  <- load_zip(zipfile)
dim(wos)
year_count(wos)
authors_top(wos)
title_word_count(wos)
tb1 = title_bigrams(wos)  
title_bigrams_separated(wos)  
tb = title_bigrams_filtered(wos)  
title_bigrams_count(wos) 
kw = keywords(wos, TRUE)
keyword_count(wos)  
keyword_count_top(wos, 2)
cr = cited_references_gather(wos)  
head(cr)
cited_reference_count(wos)  
field_tfidf(wos)
tfidf  = field_tfidf(wos)
tfidf  %>% arrange(-tf_idf)
abstract_topics(wos, 2,c('information', 'web', 'sl')) 
res = search_term(wos, 'facebook', TRUE, format_as_bibtex = FALSE) 
search_term(wos, 'platform', view = FALSE,  format_as_bibtex = TRUE) 
latex_format(res)
latex_format(res, single_ref = TRUE)

convert_file_to_bib('inst/extdata', 'test5.bib')
system('wc -l test5.bib')
system('rm test5.bib')
convert_refs_to_bib(res, 'test6.bib')
system('wc -l test6.bib')
system('rm test6.bib')

wos_words = words_all_ranked_frequencies(wos, 'AB', TRUE)
head(wos_words)
tfidf_plot(tfidf(wos_words), 30) 
wos_words = words_all_ranked_frequencies(wos, 'TI', TRUE)
tfidf_plot(tfidf(wos_words), 30) 
wm = terms_over_time(wos,combine=FALSE, field='DE', plt=TRUE,   terms_to_plot= 30)
wm
peaked_terms_monthly(wos,combine=FALSE, field='DE',  terms_to_plot= 30)
cited_references_time(wos)
term_graph(wos, 5, 'TI') 
term_graph(wos, 50, 'AB') 
term_graph(wos, 9, 'DE') 

disciplines(wos)
rian39/scilitlearn documentation built on May 20, 2019, 4:06 p.m.