library(readxl)
library(DT)
library(dplyr)
setwd("C:/Users/s-das/Syncplicity Folders/MyProjects_IMP/MY_Papers_V2/TRB 2021/00_Topics/XML")
tip03 <- read_excel("RWIS.xlsx", sheet="fin")
dim(tip03)
## [1] 75 4
## Loading required package: NLP
##
## Attaching package: 'stopwords'
## The following object is masked from 'package:tm':
##
## stopwords
stopwords_regex = paste(stopwords('en'), collapse = '\\b|\\b')
stopwords_regex = paste0('\\b', stopwords_regex, '\\b')
tip03$title1 = stringr::str_replace_all(tip03$title, stopwords_regex, '')
bigram <- tip03 %>%
unnest_tokens(bigram, title1, token = "ngrams", n = 2) %>%
count(bigram, sort = TRUE)
datatable(bigram)
stopwords_regex = paste(stopwords('en'), collapse = '\\b|\\b')
stopwords_regex = paste0('\\b', stopwords_regex, '\\b')
tip03$abstract1 = stringr::str_replace_all(tip03$abstract, stopwords_regex, '')
bigram <- tip03 %>%
unnest_tokens(bigram, title1, token = "ngrams", n = 2) %>%
count(bigram, sort = TRUE)
datatable(bigram)