Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 31, 2023
1 parent 54da76a commit f972e32
Show file tree
Hide file tree
Showing 11 changed files with 781 additions and 752 deletions.
2 changes: 1 addition & 1 deletion code/create_db.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ vd17_normalized_langs_a <- vd17_a %>%
collect() %>%
pivot_wider(id_cols = record_number:field_number, values_from = value, names_from = subfield_code, values_fn = list) %>%
rename(publication_language = a, original_language = c, intermediary_language = b) %>%
unnest_cross(c(publication_language,original_language,intermediary_language), keep_empty = TRUE) %>%
unnest_cross(c(publication_language, original_language, intermediary_language), keep_empty = TRUE) %>%
copy_to_a(con, name = dbplyr::in_schema("vd17", "vd17_normalized_langs_a"), temporary = FALSE, overwrite = TRUE, indexes = list(c("record_number", "field_number")))
vd17_normalized_langs_c <- vd17_normalized_langs_a %>%
Expand Down
85 changes: 46 additions & 39 deletions code/jiemakel/analyse-vd17.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,14 @@ vd17_c %>%
by = c("value")
) %>%
select(record_number, genre) %>%
left_join(vd17_c %>%
filter(field_code == "011@", subfield_code == "a") %>%
select(record_number, year = value) %>%
mutate(year = as.integer(year)) %>%
filter(year >= 1600, year <= 1700) %>%
collect(),
by = c("record_number")
left_join(
vd17_c %>%
filter(field_code == "011@", subfield_code == "a") %>%
select(record_number, year = value) %>%
mutate(year = as.integer(year)) %>%
filter(year >= 1600, year <= 1700) %>%
collect(),
by = c("record_number")
) %>%
mutate(genre = fct_lump_n(genre, 12)) %>%
ggplot(aes(x = year, fill = genre)) +
Expand All @@ -204,21 +205,23 @@ vd17_c %>%
vd17_c %>%
filter(field_code == "044S", subfield_code == "9") %>%
collect() %>%
left_join(vd17_044s_raw %>%
filter(field_code == "150") %>%
select(genre = value, value = ppn) %>%
collect(),
by = c("value")
left_join(
vd17_044s_raw %>%
filter(field_code == "150") %>%
select(genre = value, value = ppn) %>%
collect(),
by = c("value")
) %>%
mutate(genre = str_replace(genre, ":.*", "")) %>%
select(record_number, genre) %>%
left_join(vd17_c %>%
filter(field_code == "011@", subfield_code == "a") %>%
select(record_number, year = value) %>%
mutate(year = as.integer(year)) %>%
filter(year >= 1600, year <= 1700) %>%
collect(),
by = c("record_number")
left_join(
vd17_c %>%
filter(field_code == "011@", subfield_code == "a") %>%
select(record_number, year = value) %>%
mutate(year = as.integer(year)) %>%
filter(year >= 1600, year <= 1700) %>%
collect(),
by = c("record_number")
) %>%
mutate(genre = fct_lump_n(genre, 12)) %>%
ggplot(aes(x = year, fill = genre)) +
Expand All @@ -237,19 +240,21 @@ vd17_c %>%
```{r}
fbs_a %>%
filter(field_code == "044S", subfield_code == "9") %>%
left_join(vd17_044s_raw %>%
filter(field_code == "150") %>%
select(genre = value, value = ppn),
by = c("value")
left_join(
vd17_044s_raw %>%
filter(field_code == "150") %>%
select(genre = value, value = ppn),
by = c("value")
) %>%
mutate(genre = str_replace_all(genre, ":.*", "")) %>%
select(record_number, genre) %>%
left_join(fbs_a %>%
filter(field_code == "011@", subfield_code == "a") %>%
select(record_number, year = value) %>%
mutate(year = as.integer(year)) %>%
filter(year >= 1600, year <= 1700),
by = c("record_number")
left_join(
fbs_a %>%
filter(field_code == "011@", subfield_code == "a") %>%
select(record_number, year = value) %>%
mutate(year = as.integer(year)) %>%
filter(year >= 1600, year <= 1700),
by = c("record_number")
) %>%
count(year, genre) %>%
ungroup() %>%
Expand All @@ -272,19 +277,21 @@ fbs_a %>%
```{r}
fbs_a %>%
filter(field_code == "044S", subfield_code == "9") %>%
left_join(vd17_044s_raw %>%
filter(field_code == "150") %>%
select(genre = value, value = ppn),
by = c("value")
left_join(
vd17_044s_raw %>%
filter(field_code == "150") %>%
select(genre = value, value = ppn),
by = c("value")
) %>%
mutate(genre = str_replace_all(genre, ":.*", "")) %>%
select(record_number, genre) %>%
left_join(fbs_a %>%
filter(field_code == "011@", subfield_code == "a") %>%
select(record_number, year = value) %>%
mutate(year = as.integer(year)) %>%
filter(year >= 1600, year <= 1700),
by = c("record_number")
left_join(
fbs_a %>%
filter(field_code == "011@", subfield_code == "a") %>%
select(record_number, year = value) %>%
mutate(year = as.integer(year)) %>%
filter(year >= 1600, year <= 1700),
by = c("record_number")
) %>%
count(year, genre) %>%
ungroup() %>%
Expand Down
Loading

0 comments on commit f972e32

Please sign in to comment.