-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
57 lines (41 loc) · 1.58 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
output: github_document
---
# README
[![build](https://github.com/tbep-tech/tbep-refs/workflows/build/badge.svg)](https://github.com/tbep-tech/tbep-refs/actions)
Master references file for TBEP technical publications library and educational materials.
Formatted bibliographies:
* [Technical publications](https://tbep-tech.github.io/tbep-refs/)
* [Education materials](https://tbep-tech.github.io/tbep-refs/eduindex)
Top 100 words in titles from TBEP publications:
```{r, echo = F, fig.height = 4, fig.width = 8, message = F, warning = F}
library(googlesheets4)
library(tbeptools)
library(dplyr)
library(wordcloud)
library(RColorBrewer)
library(tm)
# options(gargle_oauth_email = "mbeck@tbep.org")
# run gs4 in a deathorized state for build
gs4_deauth()
path <- 'https://docs.google.com/spreadsheets/d/1VvEFlD_dRhp26HeOMz-CyZ5ZG9szMCziBBcniCwrUJg/edit?usp=sharing'
sht <- read_sheet(path)
sht <- as.data.frame(sht)
wrds <- sht %>%
pull(title) %>%
paste(collapse = ' ') %>%
gsub('Tampa|Bay', '', .) %>%
strsplit(' ')
docs <- Corpus(VectorSource(wrds))
docs <- docs %>%
tm_map(removeNumbers) %>%
tm_map(removePunctuation) %>%
tm_map(stripWhitespace)
docs <- tm_map(docs, content_transformer(tolower))
docs <- tm_map(docs, removeWords, stopwords("english"))
dtm <- TermDocumentMatrix(docs)
matrix <- as.matrix(dtm)
words <- sort(rowSums(matrix),decreasing=TRUE)
df <- data.frame(word = names(words),freq=words)
wordcloud(words = df$word, freq = df$freq, min.freq = 1, scale=c(2.5,0.25), max.words=100, random.order=FALSE, rot.per=0.35, colors=brewer.pal(8, "Dark2"))
```