-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeatures.qmd
More file actions
executable file
·109 lines (95 loc) · 3.94 KB
/
features.qmd
File metadata and controls
executable file
·109 lines (95 loc) · 3.94 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
---
output: html_document
editor_options:
chunk_output_type: console
---
::: {.content-visible when-profile="russian"}
## Признаки
```{r}
#| echo: false
#| message: false
library(tidyverse)
library(DT)
db <- readxl::read_xlsx("data/data.xlsx")
db |>
mutate(standardness = if_else(non_standard == 0, 'носители, недопускающие частотные/нелитературные формы', 'носители, допускающие частотные/нелитературные формы'),
feature_id0 = sprintf(str_c("%0", nchar(max(feature_id)), "d_"), feature_id)) |>
group_by(feature_id) |>
mutate(fully_st = sum(non_standard == 0),
n_fully_st = sum(non_standard != 0),
standardness = str_c(n_fully_st, " из ", fully_st+n_fully_st, " носителей"),
filename = str_replace_all(feature_title, "[\\s:\\./]", "_"),
filename = str_replace_all(filename, "č", "ch"),
filename = str_replace_all(filename, "š", "sh"),
filename = str_replace_all(filename, "ž", "zh"),
filename = str_remove_all(filename, "\\*"),
filename = str_to_lower(filename),
filename = str_c(feature_id0, filename),
feature_title_ru = str_remove_all(feature_title_ru, "\\*"),
feature_title_ru = str_c("<a href='source/ru/",
filename,
".html'>",
feature_title_ru,
"</a>"),
for_sorting = n_fully_st/fully_st) |>
ungroup() |>
arrange(-for_sorting) |>
# select(feature_title_ru, standardness, contributor_ru) |>
select(feature_title_ru, standardness) |>
rename(`название признака` = feature_title_ru,
# `исследователи` = contributor_ru,
`вариативные носители` = standardness) |>
distinct() |>
DT::datatable(filter = 'top',
escape = FALSE,
rownames = FALSE,
options = list(pageLength = 150,
autoWidth = TRUE,
dom = 'fltpi'))
```
:::
::: {.content-visible when-profile="english"}
## Features
```{r}
#| echo: false
#| message: false
library(tidyverse)
library(DT)
# table with features
db <- readxl::read_xlsx("data/data.xlsx")
db |>
mutate(standardness = if_else(non_standard == 0, 'fully standard speakers', 'non-fully standard speakers'),
feature_id0 = sprintf(str_c("%0", nchar(max(feature_id)), "d_"), feature_id)) |>
group_by(feature_id) |>
mutate(fully_st = sum(non_standard == 0),
n_fully_st = sum(non_standard != 0),
standardness = str_c(n_fully_st, " out of ", n_fully_st+fully_st, " speakers"),
filename = str_replace_all(feature_title, "[\\s:\\./]", "_"),
filename = str_replace_all(filename, "č", "ch"),
filename = str_replace_all(filename, "š", "sh"),
filename = str_replace_all(filename, "ž", "zh"),
filename = str_remove_all(filename, "\\*"),
filename = str_to_lower(filename),
filename = str_c(feature_id0, filename),
feature_title = str_remove_all(feature_title, "\\*"),
feature_title = str_c("<a href='source/en/",
filename,
".html'>",
feature_title,
"</a>"),
for_sorting = n_fully_st/fully_st) |>
ungroup() |>
arrange(-for_sorting) |>
# select(feature_title, standardness, contributor) |>
select(feature_title, standardness) |>
rename(feature = feature_title,
`speakers with variation` = standardness) |>
distinct() |>
DT::datatable(filter = 'top',
escape = FALSE,
rownames = FALSE,
options = list(pageLength = 150,
autoWidth = TRUE,
dom = 'fltpi'))
```
:::