Skip to content

Commit 4e067c3

Browse files
committed
fixes
1 parent 2cd4b59 commit 4e067c3

File tree

5 files changed

+183
-53
lines changed

5 files changed

+183
-53
lines changed

bg_df.R

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
library(tidyverse)
2+
library(googlesheets4)
3+
4+
5+
# Create df ---------------------------------------------------------------
6+
7+
con <- googlesheets4::read_sheet("https://docs.google.com/spreadsheets/d/1UXBQs_tu0cRYN3XDEPsq3MxlUNvryPEnR-ClSp2uipo/edit?gid=0#gid=0",
8+
sheet = "conferences") %>% mutate(activity = "conferences")
9+
edu <- googlesheets4::read_sheet("https://docs.google.com/spreadsheets/d/1UXBQs_tu0cRYN3XDEPsq3MxlUNvryPEnR-ClSp2uipo/edit?gid=0#gid=0",
10+
sheet = "edu") %>% mutate(activity = "education")
11+
int <- googlesheets4::read_sheet("https://docs.google.com/spreadsheets/d/1UXBQs_tu0cRYN3XDEPsq3MxlUNvryPEnR-ClSp2uipo/edit?gid=0#gid=0",
12+
sheet = "internships") %>% mutate(activity = "research stays")
13+
emp <- googlesheets4::read_sheet("https://docs.google.com/spreadsheets/d/1UXBQs_tu0cRYN3XDEPsq3MxlUNvryPEnR-ClSp2uipo/edit?gid=0#gid=0",
14+
sheet = "work") %>% mutate(activity = "employment")
15+
team <- googlesheets4::read_sheet("https://docs.google.com/spreadsheets/d/1UXBQs_tu0cRYN3XDEPsq3MxlUNvryPEnR-ClSp2uipo/edit?gid=0#gid=0",
16+
sheet = "team")
17+
18+
full_df <- full_join(con, edu, by = c("start_date", "end_date", "city", "country", "name", "who", "activity")) %>%
19+
full_join(., int, by = c("start_date", "end_date", "city", "country", "name", "who", "activity")) %>%
20+
full_join(., emp, by = c("start_date", "end_date", "city", "country", "name", "who", "group", "faculty", "activity")) %>%
21+
full_join(., team, by = c("who")) %>%
22+
mutate(start_date = as.Date(start_date, "%d.%m.%Y"),
23+
start_date = if_else(is.na(start_date), today(), start_date),
24+
end_date = as.Date(end_date, "%d.%m.%Y"),
25+
end_date = if_else(is.na(end_date), today(), end_date),
26+
cat = as.factor(activity),
27+
type = as.factor(type),
28+
who = as.factor(who),
29+
full_name = if_else(full_name %>% is.na(), name, full_name)) %>%
30+
filter(team == "main")

codes.R

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,15 @@
1-
library(fontawesome)
21
library(tidyverse)
3-
library(googlesheets4)
42
library(ggalt)
53
library(patchwork)
64
library(RColorBrewer)
75

8-
9-
# Create df ---------------------------------------------------------------
10-
11-
con <- googlesheets4::read_sheet("https://docs.google.com/spreadsheets/d/1UXBQs_tu0cRYN3XDEPsq3MxlUNvryPEnR-ClSp2uipo/edit?gid=0#gid=0",
12-
sheet = "conferences") %>% mutate(activity = "conferences")
13-
edu <- googlesheets4::read_sheet("https://docs.google.com/spreadsheets/d/1UXBQs_tu0cRYN3XDEPsq3MxlUNvryPEnR-ClSp2uipo/edit?gid=0#gid=0",
14-
sheet = "edu") %>% mutate(activity = "education")
15-
int <- googlesheets4::read_sheet("https://docs.google.com/spreadsheets/d/1UXBQs_tu0cRYN3XDEPsq3MxlUNvryPEnR-ClSp2uipo/edit?gid=0#gid=0",
16-
sheet = "internships") %>% mutate(activity = "research stays")
17-
emp <- googlesheets4::read_sheet("https://docs.google.com/spreadsheets/d/1UXBQs_tu0cRYN3XDEPsq3MxlUNvryPEnR-ClSp2uipo/edit?gid=0#gid=0",
18-
sheet = "work") %>% mutate(activity = "employment")
19-
team <- googlesheets4::read_sheet("https://docs.google.com/spreadsheets/d/1UXBQs_tu0cRYN3XDEPsq3MxlUNvryPEnR-ClSp2uipo/edit?gid=0#gid=0",
20-
sheet = "team")
21-
22-
full_df <- full_join(con, edu, by = c("start_date", "end_date", "city", "country", "name", "who", "activity")) %>%
23-
full_join(., int, by = c("start_date", "end_date", "city", "country", "name", "who", "activity")) %>%
24-
full_join(., emp, by = c("start_date", "end_date", "city", "country", "name", "who", "group", "faculty", "activity")) %>%
25-
full_join(., team, by = c("who")) %>%
26-
mutate(start_date = as.Date(start_date, "%d.%m.%Y"),
27-
start_date = if_else(is.na(start_date), today(), start_date),
28-
end_date = as.Date(end_date, "%d.%m.%Y"),
29-
end_date = if_else(is.na(end_date), today(), end_date),
30-
cat = as.factor(activity),
31-
type = as.factor(type),
32-
who = as.factor(who),
33-
full_name = if_else(full_name %>% is.na(), name, full_name)) %>%
34-
filter(team == "main")
35-
36-
376
# prepare plots -----------------------------------------------------------
387

39-
my_colors <- scale_fill_hue()$palette(full_df$who %>% levels() %>% length())
40-
names(my_colors) <- full_df$who %>% levels()
8+
my_colors <- scale_fill_hue()$palette(full_df_mod$who %>% levels() %>% length())
9+
names(my_colors) <- full_df_mod$who %>% levels()
4110

42-
p <- lapply(full_df$cat %>% levels(), function(i){
43-
full_df %>%
11+
p <- lapply(full_df_mod$cat %>% levels(), function(i){
12+
full_df_mod %>%
4413
filter(activity == i) %>%
4514
ggplot(., aes(y = name, color = who)) +
4615
geom_segment(aes(x = start_date, xend = end_date), linewidth = 2, position = position_dodgev(height = 0.9)) +
@@ -82,7 +51,7 @@ gapminder_data <- gapminder %>%
8251

8352
## cities <- lon & lat
8453

85-
full_df_longlat <- full_df %>% geocode(city = city, country = country)
54+
full_df_longlat <- full_df_mod %>% geocode(city = city, country = country)
8655

8756
world_visit <- world %>%
8857
ggplot() +

subsite/seminars.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ sem_df <- read_lines(URL)[-c(1:2)] %>% str_flatten() %>%
2626
# separate(., col = rest, into = c("title", "presenting"), sep = "\\*, ", extra = "merge") %>%
2727
# str_remove_all(., "^[0-9]+. ") %>% str_remove_all(., "\\n") %>% as_tibble()
2828
29-
cat(sem_df$rmarkdown)
29+
cat(sem_df$rmarkdown)
3030
3131
# sem_df %>% DT::datatable()
3232

subsite/team.qmd

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@ title: "BioGenies team"
2222

2323
:::
2424

25+
```{r, include=FALSE}
26+
source("../bg_df.R")
27+
28+
full_df_mod <- full_df %>% filter(team == "main")
29+
30+
source("../codes.R")
31+
```
32+
33+
### 🚀 Our mobility
34+
```{r, echo=FALSE, message=FALSE, fig.width=12, fig.height=8}
35+
pw_plot
36+
```
37+
38+
### 🗺️ Countries visited
39+
```{r, echo=FALSE, message=FALSE, fig.width=12, fig.height=8}
40+
inter_plot
41+
```
42+
2543
### 🐶 Our doggos and cattos 😼
2644
::: {layout-ncol=4}
2745
[![Czarek](fig/ppl/Czarson.jpeg "Climbing dog"){}]()
@@ -35,16 +53,3 @@ title: "BioGenies team"
3553
[![Piksel](fig/ppl/piksel.jpeg "Hot dog"){}]()
3654
:::
3755

38-
```{r, include=FALSE}
39-
source("../codes.R")
40-
```
41-
### 🚀 Our mobility
42-
```{r, echo=FALSE, message=FALSE, fig.width=12, fig.height=8}
43-
pw_plot
44-
```
45-
46-
47-
### 🗺️ Countries we visited
48-
```{r, echo=FALSE, message=FALSE, fig.width=12, fig.height=8}
49-
inter_plot
50-
```

subsite/team/jc.qmd

Lines changed: 129 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,119 @@ format:
88
body-width: 1500px
99
margin-width: 300px
1010
gutter-width: 1.5rem
11+
knitr:
12+
opts_chunk:
13+
out.width: "95%"
1114
---
1215

1316
```{r, echo=FALSE, message=FALSE}
14-
library("fontawesome")
17+
library(fontawesome)
18+
library(tidyverse)
19+
library(googlesheets4)
20+
library(ggalt)
21+
library(patchwork)
22+
library(RColorBrewer)
23+
24+
con <- googlesheets4::read_sheet("https://docs.google.com/spreadsheets/d/1UXBQs_tu0cRYN3XDEPsq3MxlUNvryPEnR-ClSp2uipo/edit?gid=0#gid=0",
25+
sheet = "conferences") %>% mutate(activity = "conferences")
26+
edu <- googlesheets4::read_sheet("https://docs.google.com/spreadsheets/d/1UXBQs_tu0cRYN3XDEPsq3MxlUNvryPEnR-ClSp2uipo/edit?gid=0#gid=0",
27+
sheet = "edu") %>% mutate(activity = "education")
28+
int <- googlesheets4::read_sheet("https://docs.google.com/spreadsheets/d/1UXBQs_tu0cRYN3XDEPsq3MxlUNvryPEnR-ClSp2uipo/edit?gid=0#gid=0",
29+
sheet = "internships") %>% mutate(activity = "research stays")
30+
emp <- googlesheets4::read_sheet("https://docs.google.com/spreadsheets/d/1UXBQs_tu0cRYN3XDEPsq3MxlUNvryPEnR-ClSp2uipo/edit?gid=0#gid=0",
31+
sheet = "work") %>% mutate(activity = "employment")
32+
team <- googlesheets4::read_sheet("https://docs.google.com/spreadsheets/d/1UXBQs_tu0cRYN3XDEPsq3MxlUNvryPEnR-ClSp2uipo/edit?gid=0#gid=0",
33+
sheet = "team")
34+
35+
full_df <- full_join(con, edu, by = c("start_date", "end_date", "city", "country", "name", "who", "activity")) %>%
36+
full_join(., int, by = c("start_date", "end_date", "city", "country", "name", "who", "activity")) %>%
37+
full_join(., emp, by = c("start_date", "end_date", "city", "country", "name", "who", "group", "faculty", "activity")) %>%
38+
full_join(., team, by = c("who")) %>%
39+
mutate(start_date = as.Date(start_date, "%d.%m.%Y"),
40+
start_date = if_else(is.na(start_date), today(), start_date),
41+
end_date = as.Date(end_date, "%d.%m.%Y"),
42+
end_date = if_else(is.na(end_date), today(), end_date),
43+
cat = as.factor(activity),
44+
type = as.factor(type),
45+
who = as.factor(who),
46+
full_name = if_else(full_name %>% is.na(), name, full_name)) %>%
47+
filter(team == "main")
48+
49+
50+
# plots
51+
52+
my_colors <- scale_fill_hue()$palette(full_df$who %>% levels() %>% length())
53+
names(my_colors) <- full_df$who %>% levels()
54+
55+
p <- lapply(full_df$cat %>% levels(), function(i){
56+
full_df %>%
57+
filter(activity == i) %>%
58+
ggplot(., aes(y = name, color = who)) +
59+
geom_segment(aes(x = start_date, xend = end_date), linewidth = 2, position = position_dodgev(height = 0.9)) +
60+
geom_point(aes(x = start_date, y = name), size = 3, position = position_dodgev(height = 0.9)) +
61+
geom_point(aes(x = end_date, y = name), size = 3, position = position_dodgev(height = 0.9)) +
62+
scale_fill_manual(values = my_colors, aesthetics = "color") +
63+
labs(title = paste0("BioGenies ", i), x = "Year", y = "Destination") +
64+
theme_minimal() +
65+
xlab("Dates")
66+
})
67+
68+
69+
# pw_plot <- (p[[1]] & theme(legend.position = "bottom")) + ((p[[2]] / p[[3]] / p[[4]]) & theme(legend.position = "none")) + plot_layout(guides = "auto")
70+
71+
pw_plot <- (p[[1]] | (p[[2]] / p[[3]] / p[[4]] & theme(legend.position = "none")) + plot_layout(axes = "collect", axis_titles = "collect"))
72+
73+
pw_plot
74+
75+
76+
# map
77+
78+
library(gapminder)
79+
library(tidygeocoder)
80+
library(plotly)
81+
library(ggthemes)
82+
83+
world <- map_data("world") %>%
84+
filter(region != "Antarctica")
85+
86+
gapminder_codes <- gapminder::country_codes
87+
gapminder <- gapminder::gapminder_unfiltered
88+
89+
gapminder <- gapminder %>%
90+
inner_join(gapminder_codes, by= "country") %>%
91+
mutate(code = iso_alpha)
92+
93+
gapminder_data <- gapminder %>%
94+
inner_join(maps::iso3166 %>%
95+
select(a3, mapname), by= c(code = "a3")) %>%
96+
mutate(mapname = str_remove(mapname, "\\(.*"))
97+
98+
## cities <- lon & lat
99+
100+
full_df_longlat <- full_df %>% geocode(city = city, country = country)
101+
102+
world_visit <- world %>%
103+
ggplot() +
104+
geom_polygon(aes(x = long, y = lat, group = group),
105+
fill = "springgreen2",
106+
color = "deepskyblue1",
107+
size = 0.01) +
108+
geom_point(data = full_df_longlat, aes(x = long, y = lat, color = activity, text = paste0(activity, "<br>", city, " ", country, "<br>", who)), alpha = 0.6) +
109+
labs(title = "BioGenies in the world") +
110+
theme_map() +
111+
scale_size_continuous(guide = F) +
112+
scale_color_discrete(name = "Type") +
113+
theme(plot.title = element_text(size = 10, hjust = 0.5))
114+
115+
116+
inter_plot <- ggplotly(world_visit, tooltip = "text")
117+
118+
inter_plot
15119
```
16120

17-
### Contact Info {#contact}
121+
### Bio
122+
123+
### Contact info {#contact}
18124

19125
------------------------------------------------------------------------
20126

@@ -26,4 +132,24 @@ library("fontawesome")
26132
<!-- [`r fontawesome::fa("twitter", fill = "#15a7ff", height = "3em")`](https://twitter.com/_jarochi/) -->
27133
[`r fontawesome::fa("x-twitter", fill = "#24292e", height = "3em")`](https://x.com/_jarochi/)
28134
<!-- [`r fontawesome::fa("steam", fill = "#2f4f4f", height = "3em")`]() -->
29-
<!-- [`r fontawesome::fa("playstation", fill = "#4739aa", height = "3em")`]() -->
135+
<!-- [`r fontawesome::fa("playstation", fill = "#4739aa", height = "3em")`]() -->
136+
137+
### Conferences and workshops
138+
139+
# ```{r, echo=FALSE, message=FALSE}
140+
# int_mod %>%
141+
# ggplot(., aes(x = start_date, xend = end_date, y = place, color = country, linewidth = 3), height = 2, width = 8) +
142+
# # scale_x_date(date_breaks = "6 month", date_labels = "%M") +
143+
# geom_dumbbell(colour_x = "#a3c4dc", colour_xend = "#0e668b", size = 2) +
144+
# theme_minimal()
145+
# ```
146+
#
147+
# ```{r, echo=FALSE, message=FALSE}
148+
# DT::datatable(int_mod)
149+
# ```
150+
151+
152+
153+
154+
155+

0 commit comments

Comments
 (0)