Skip to content

[pre-commit.ci] pre-commit autoupdate #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: '\.Rd'
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 6.0.1
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.5.7
- repo: https://github.com/hhatto/autopep8
rev: v2.3.2
hooks:
- id: autopep8
args: ["--max-line-length=120", "-i"]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
rev: v1.10.0
hooks:
- id: python-use-type-annotations
- repo: https://github.com/lorenzwalthert/precommit
rev: v0.1.3.9135
rev: v0.4.3.9011
hooks:
- id: style-files
args: [--style_pkg=styler, --style_fun=tidyverse_style]
Expand All @@ -43,4 +43,3 @@ repos:
# language: system
# types: [python]
# args: ["--fail-under=7.0","--max-line-length=120"]

875 changes: 437 additions & 438 deletions docs/overview.Rmd

Large diffs are not rendered by default.

282 changes: 141 additions & 141 deletions docs/overview.html

Large diffs are not rendered by default.

238 changes: 119 additions & 119 deletions docs/overview.nb.html

Large diffs are not rendered by default.

117 changes: 59 additions & 58 deletions map-experiments.Rmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "General statistical overviews of FILTER data"
date: "`r Sys.Date()`"
output:
output:
html_notebook:
code_folding: hide
toc: yes
Expand All @@ -11,110 +11,111 @@ output:
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(message=FALSE,dpi=300,fig.retina=2,fig.width=8)
knitr::opts_chunk$set(message = FALSE, dpi = 300, fig.retina = 2, fig.width = 8)
source(here::here("src/common_basis.R"))
tmap_mode("plot")
```

```{r}
polygons %>%
filter(map_id==1) %>%
polygons %>%
filter(map_id == 1) %>%
left_join(p_pl %>% count(pl_id) %>% collect()) %>%
replace_na(list(n=0)) %>%
replace_na(list(n = 0)) %>%
group_by(pol_id, geometry) %>%
summarise(n=sum(n)) %>%
summarise(n = sum(n)) %>%
tm_shape() +
tm_polygons(col='n', id='name', style='fisher', palette='plasma') +
tm_layout(main.title="Exp-1")
tm_polygons(col = "n", id = "name", style = "fisher", palette = "plasma") +
tm_layout(main.title = "Exp-1")
```

```{r}
polygons %>%
filter(map_id==0) %>%
polygons %>%
filter(map_id == 0) %>%
left_join(p_pl %>% count(pl_id) %>% collect()) %>%
group_by(pol_id, geometry) %>%
summarise(n=sum(n)) %>%
summarise(n = sum(n)) %>%
tm_shape() +
tm_polygons(col='n', id='name', style='fisher', palette='plasma') +
tm_layout(main.title="Exp-1")
tm_polygons(col = "n", id = "name", style = "fisher", palette = "plasma") +
tm_layout(main.title = "Exp-1")
```

```{r}
polygons %>%
filter(map_id==0) %>%
polygons %>%
filter(map_id == 0) %>%
left_join(p_pl %>% count(pl_id) %>% collect()) %>%
group_by(pol_id, geometry) %>%
summarise(n=sum(n)) %>%
summarise(n = sum(n)) %>%
tm_shape() +
tm_polygons() +
tm_bubbles(size = "n", col="n") +
tm_layout(main.title="Exp-1")
tm_bubbles(size = "n", col = "n") +
tm_layout(main.title = "Exp-1")
```
```{r}
polygons %>%
filter(map_id==1) %>%
polygons %>%
filter(map_id == 1) %>%
left_join(p_pl %>% count(pl_id) %>% collect()) %>%
replace_na(list(n=0)) %>%
replace_na(list(n = 0)) %>%
group_by(pol_id, geometry) %>%
summarise(n=sum(n)) %>%
tm_shape(point.per="largest") +
summarise(n = sum(n)) %>%
tm_shape(point.per = "largest") +
tm_polygons() +
tm_bubbles(size = "n", col="n") +
tm_layout(main.title="Exp-1")
tm_bubbles(size = "n", col = "n") +
tm_layout(main.title = "Exp-1")
```

```{r}
d <- polygons %>%
filter(map_id==0) %>%
d <- polygons %>%
filter(map_id == 0) %>%
left_join(p_pl %>% inner_join(poems) %>% count(collection, pl_id) %>% collect()) %>%
replace_na(list(n=0)) %>%
replace_na(list(n = 0)) %>%
group_by(collection, pol_id, geometry) %>%
summarise(n=sum(n)) %>%
summarise(n = sum(n)) %>%
group_by(pol_id) %>%
mutate(tn=sum(n)) %>%
mutate(tn = sum(n)) %>%
ungroup() %>%
mutate(pol_id=str_c("p", pol_id), collection=as_factor(collection))
mutate(pol_id = str_c("p", pol_id), collection = as_factor(collection))

plot_cols <- coloropt_pal()(4)

grps <- d %>%
# filter(!is.na(n)) %>%
complete(nesting(pol_id,tn,geometry),collection,fill=list(n=0)) %>%
group_by(pol_id)
grobs <- grps %>%
group_map(~ggplotGrob(ggplot(.x, aes(x="", y=n, fill=collection)) +
geom_col(width=1) +
scale_y_continuous(expand=c(0,0)) +
scale_fill_manual(values=plot_cols) +
theme_ps(plot.axes = FALSE))
) %>%
grps <- d %>%
# filter(!is.na(n)) %>%
complete(nesting(pol_id, tn, geometry), collection, fill = list(n = 0)) %>%
group_by(pol_id)
grobs <- grps %>%
group_map(~ ggplotGrob(ggplot(.x, aes(x = "", y = n, fill = collection)) +
geom_col(width = 1) +
scale_y_continuous(expand = c(0, 0)) +
scale_fill_manual(values = plot_cols) +
theme_ps(plot.axes = FALSE))) %>%
set_names(group_keys(grps) %>% pull())
```


```{r,fig.width=10,fig.height=14}
d %>%
distinct(pol_id,geometry,tn) %>%
tm_shape(point.per="largest") +
distinct(pol_id, geometry, tn) %>%
tm_shape(point.per = "largest") +
tm_polygons() +
tm_symbols(shape="pol_id",
shapes=grobs,
size="tn",
legend.shape.show = FALSE,
legend.size.is.portrait = TRUE,
shapes.legend = 22) +
tm_add_legend(type="fill",
col=plot_cols,
labels=c("erab", "jr", "literary", "skvr"),
title="Collection")

tm_symbols(
shape = "pol_id",
shapes = grobs,
size = "tn",
legend.shape.show = FALSE,
legend.size.is.portrait = TRUE,
shapes.legend = 22
) +
tm_add_legend(
type = "fill",
col = plot_cols,
labels = c("erab", "jr", "literary", "skvr"),
title = "Collection"
)
```

```{r}
d %>%
tm_shape() +
tm_polygons() +
tm_bubbles(size="n") +
tm_facets(by="collection",ncol=4)
tm_bubbles(size = "n") +
tm_facets(by = "collection", ncol = 4)
```

Loading