Skip to content

Commit

Permalink
Fix wordcloud2 and add session_info()
Browse files Browse the repository at this point in the history
- wordclould 0.2.1 has an issue only rendering one wordcloud. THis is fixed in the dev version from Github (Lchiffon/wordcloud2#34)
  • Loading branch information
mrustl committed Feb 1, 2019
1 parent 565cd47 commit 5be0931
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 13 deletions.
2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ Suggests:
jsonld,
pkgnet,
printr,
sessioninfo,
tibble,
tidyr,
wordcloud2
VignetteBuilder:
knitr
Remotes:
github::Lchiffon/wordcloud2,
github::kwb-r/kwb.pkgstatus,
github::kwb-r/kwb.utils,
github::ropensci/codemetar@dev,
Expand Down
86 changes: 73 additions & 13 deletions vignettes/codemetar-analysis.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,21 @@ pkg_topics
```

```{r, eval = TRUE}
tidyr::separate_rows(pkg_topics, topic, sep = ",\\s+") %>%
topics <- tidyr::separate_rows(pkg_topics, topic, sep = ",\\s+") %>%
dplyr::count(topic) %>%
dplyr::filter(!topic %in% c("r", "rstats")) %>%
dplyr::arrange(dplyr::desc(n)) %>%
dplyr::rename(word = topic,
freq = n) %>%
wordcloud2::wordcloud2()
freq = n)
knitr::kable(topics)
```

```{r wordcloud_topics, eval = TRUE}
wordcloud2::wordcloud2(topics)
```


Expand Down Expand Up @@ -102,15 +109,21 @@ purrr::map_chr(corpus, c("maintainer", "familyName")) %>%

```{r, eval = TRUE}
## Mostly Hauke
purrr::map_chr(corpus, c("maintainer", "familyName")) %>%
maintainer <- purrr::map_chr(corpus, c("maintainer", "familyName")) %>%
tibble::enframe(name = NULL) %>%
dplyr::group_by(value) %>%
dplyr::tally(sort=TRUE) %>%
dplyr::rename(word = value,
freq = n) %>%
wordcloud2::wordcloud2(minSize = 0.2,
size = 0.7)
freq = n)
knitr::kable(maintainer)
```

```{r wordcloud_maintainer, eval = TRUE}
wordcloud2::wordcloud2(maintainer,
minSize = 0.4,
size = 0.8)
```


Expand Down Expand Up @@ -159,13 +172,20 @@ corpus %>%
#which dependencies are used most frequently?
dep_df %>%
dep_count <- dep_df %>%
dplyr::group_by(dep) %>%
dplyr::tally(sort = TRUE) %>%
dplyr::rename(word = dep,
freq = n) %>%
wordcloud2::wordcloud2()
freq = n)
knitr::kable(dep_count)
```

```{r wordcloud_depends_imports, eval = TRUE}
wordcloud2::wordcloud2(dep_count,
minSize = 0.4,
size = 1)
```

## Depends Imports and Suggests
Expand All @@ -179,14 +199,54 @@ dep_frame <- '{
"@explicit": "true",
"name": {}
}'
jsonld_frame("codemetar.json", dep_frame) %>%
dep_sug_count <- jsonld_frame("codemetar.json", dep_frame) %>%
fromJSON() %>%
getElement("@graph") %>%
filter(type == "SoftwareApplication") %>%
group_by(name) %>%
tally(sort = TRUE) %>%
dplyr::rename(word = name,
freq = n) %>%
wordcloud2::wordcloud2()
freq = n)
knitr::kable(dep_sug_count)
```

```{r wordcloud_depends_imports_suggests, eval = TRUE}
wordcloud2::wordcloud2(dep_sug_count,
minSize = 0.4,
size = 1)
```

# 7 Session Info

## Plattform

```{r plattform, eval = TRUE, echo= FALSE}
environment <- sessioninfo::session_info()
knitr::kable(tibble::enframe(unlist(environment$platform)))
```

## Packages

```{r packages, eval = TRUE, echo= FALSE}
print(environment$packages)
```

### Pandoc

```{r pandoc, eval = TRUE, echo= FALSE}
if(rmarkdown::pandoc_available()) {
data.frame(pandoc_directory = rmarkdown::pandoc_exec(),
pandoc_version = as.character(rmarkdown::pandoc_version()),
stringsAsFactors = FALSE)
} else {
print("No PANDOC installed!")
}
```

0 comments on commit 5be0931

Please sign in to comment.