-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfeatures.Rmd
executable file
·52 lines (47 loc) · 1.55 KB
/
features.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
---
title: "Features"
output:
html_document:
include:
in_header: ./html/header_features.html
editor_options:
chunk_output_type: console
---
```{r, echo=FALSE, message = FALSE}
library(tidyverse)
library(DT)
# table with features
readxl::read_xlsx("data/contributors.xlsx") %>%
filter(render == 1) ->
features
features$id_0 <- sprintf(paste0("%0", nchar(max(features$id))+1, "d_"),
features$id)
features %>%
filter(!is.na(major_topic_text)) %>%
mutate(major_topic_linked = str_c("<a href='",
str_c(filename),
".html'>",
major_topic,
"</a>")) %>%
select(major_topic, major_topic_linked) ->
major_topics
features %>%
filter(is.na(major_topic_text)) %>%
mutate(feature = str_c(title,
"<br><a href='",
str_c(id_0, filename),
".html'>Chapter</a>|<a href='",
str_c(id_0, filename),
"_map.html'>Maps&Data</a>")) %>%
select(feature, author, major_topic, area) %>%
left_join(major_topics) %>%
select(-major_topic) %>%
rename(`major topic` = major_topic_linked) %>%
mutate(area = factor(area)) %>%
DT::datatable(filter = 'top',
escape = FALSE,
rownames = FALSE,
options = list(pageLength = 150,
autoWidth = TRUE,
dom = 'fltpi'))
```