Skip to content

Commit b10f3ce

Browse files
committed
updates and fixes
1 parent 8f2c1e6 commit b10f3ce

File tree

102 files changed

+6533
-1588
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+6533
-1588
lines changed

R/bg_df.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ emp <- googlesheets4::read_sheet(link, sheet = "work") %>% mutate(activity = "em
1313
team <- googlesheets4::read_sheet(link, sheet = "team")
1414
other_act_df <- googlesheets4::read_sheet(link, sheet = "other_activities")
1515

16+
pub_overwrite <- googlesheets4::read_sheet(link, sheet = "pub_overwrite")
17+
1618
full_df <- full_join(con, edu, by = c("start_date", "end_date", "city", "country", "name", "who", "activity")) %>%
1719
full_join(., int, by = c("start_date", "end_date", "city", "country", "name", "who", "activity")) %>%
1820
full_join(., emp, by = c("start_date", "end_date", "city", "country", "name", "who", "group", "faculty", "activity")) %>%
@@ -28,5 +30,5 @@ full_df <- full_join(con, edu, by = c("start_date", "end_date", "city", "country
2830

2931
remove(link)
3032

31-
save.image(file = 'bg_df_data.RData')
32-
# load("bg_df_data.RData")
33+
# save.image(file = 'data/bg_df_data.RData')
34+
# load("databg_df_data.RData")

R/create_ppl_page.R

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# whois_full_name <- "Michał"
22
# whois <- whois
3-
# whois <- "Jarek"
3+
# whois <- "Asia"
44

5-
# source('R/bg_df.R')
65
load("bg_df_data.RData")
76
source('R/resume_fun.R')
87

@@ -25,7 +24,7 @@ knitr:
2524
---
2625
2726
```{r, echo=FALSE, message=FALSE,include=FALSE}
28-
source('../../R/bg_df.R')
27+
load('../../data/bg_df_data.RData')
2928
whois <- '", whois, "'\n\n",
3029
"source('../../R/resume_fun.R')
3130
openalex_id <- basic_info(whois)$openalex_id
@@ -116,7 +115,7 @@ paste0(
116115

117116

118117
conference_txt <- if_else((full_df %>% filter(who == whois & cat == "conferences") %>% nrow()) != 0, paste0(
119-
"# 👏🏻 **Conferences, workshops** 🤝🏻
118+
"# 👏🏻 **Conferences, workshops, training schools** 🤝🏻
120119
121120
------------------------------------------------------------------------
122121
@@ -125,7 +124,7 @@ conf_work(whois)
125124
```
126125
\n"),
127126
paste0(
128-
"<!-- # 👏🏻 **Conferences, workshops** 🤝🏻 -->
127+
"<!-- # 👏🏻 **Conferences, workshops, training schools** 🤝🏻 -->
129128
130129
<!-- ------------------------------------------------------------------------ -->
131130
@@ -134,7 +133,7 @@ paste0(
134133
<!-- ``` -->", "\n"))
135134

136135

137-
publication_txt <- if_else((openalexR::oa_fetch(entity ="works", author.id = basic_info(whois)$openalex_id) %>% nrow()) != 0, paste0(
136+
publication_txt <- if_else((openalexR::oa_fetch(entity ="works", author.id = basic_info(whois)$openalex_id) %>% try() %>% nrow()) != 0, paste0(
138137
"# 📖 **Publications**
139138
140139
------------------------------------------------------------------------

R/gen_team_files.R

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
source('R/create_ppl_page.R')
2+
3+
for (i in team %>% filter(team == "main") %>% .$who) {
4+
print(i)
5+
temp_df <- team %>% filter(who == i)
6+
whois <- i
7+
whois_full_name <- temp_df$whois_full_name
8+
file_name <- paste0("subsite/team/", temp_df$file_name)
9+
10+
create_ppl_page(whois_full_name, whois, file_name)
11+
}
12+
13+
14+
for (i in team %>% filter(team == "colab") %>% .$who) {
15+
print(i)
16+
temp_df <- team %>% filter(who == i)
17+
whois <- i
18+
whois_full_name <- temp_df$whois_full_name
19+
file_name <- paste0("subsite/colab/", temp_df$file_name)
20+
21+
create_ppl_page(whois_full_name, whois, file_name)
22+
}

R/resume_fun.R

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ education <- function(whois){
2626
edu_df <- full_df %>%
2727
filter(who == whois & cat == "education") %>%
2828
arrange(desc(end_date)) %>%
29-
mutate(new_col = paste0("<h3>", "![](../fig/logo/", logo_name, "){width='50'} ", name, "</h3>\n", "<h4> ", major, "</h4> [ ", start_date, " - ", end_date, " ]", "{style='float:right;'}", "<br> ", if_else(thesis_title %>% is.na, " ", paste0("Thesis: **", thesis_title, "** ")), "[ 📍 ", city, ", ", country, " ]{style='float:right;'}"
29+
mutate(new_col = paste0("<h3>", "![](../fig/logo/", logo_name, "){width='50'} ", name, "</h3>\n", "<h4> ", major, "</h4> [ ", start_date, " - ", end_date, " ]", "{style='float:right;'}", "<br> ", if_else(thesis_title %>% is.na, " ", paste0(degree, " thesis: **", thesis_title, "** ")), "[ 📍 ", city, ", ", country, " ]{style='float:right;'}"
3030
))
3131
}
3232

@@ -56,9 +56,44 @@ pubs <- function(whois, openalex_id){
5656
tibble(authors = .) %>%
5757
cbind(pub, .)
5858

59+
60+
pub_mod <- pub_mod$author %>%
61+
lapply(., function(x){
62+
number <- x$au_id %>% str_detect(openalex_id) %>% which()
63+
position <- x$author_position[number]
64+
}) %>%
65+
unlist(.) %>%
66+
tibble(position = .) %>%
67+
cbind(pub_mod, .)
68+
69+
# for (i in pub_overwrite %>% filter(who == whois) %>% select(doi) %>% as.vector()) {
70+
# pub_mod <- pub_mod %>%
71+
# mutate(position = if_else(str_detect(doi, i), "first", position))
72+
# }
73+
74+
75+
pub_mod <- pub_mod$author %>%
76+
lapply(., function(x){
77+
number <- x$au_id %>% str_detect(openalex_id) %>% which(.)
78+
corresponding <- x$is_corresponding[number]
79+
}) %>%
80+
unlist(.) %>%
81+
tibble(corresponding = .) %>%
82+
cbind(pub_mod, .)
83+
84+
# for (i in pub_overwrite %>% filter(who == whois) %>% select(doi) %>% as.vector()) {
85+
# pub_mod <- pub_mod %>%
86+
# mutate(corresponding = if_else(str_detect(doi, i), TRUE, corresponding))
87+
# }
88+
5989
pub_mod %>%
6090
filter(type != "dataset") %>%
61-
select(title, authors, doi, publication_date, type, so, host_organization) %>%
91+
# select(title, authors, doi, publication_date, type, so, host_organization) %>%
92+
mutate(authorship = paste0(
93+
if_else(position == "middle", "coauthor", position),
94+
if_else(corresponding == TRUE, ",\n corresponding", "")
95+
)) %>%
96+
select(title, authors, doi, publication_date, type, so, host_organization, authorship) %>%
6297
drop_na(., doi) %>%
6398
mutate(doi = paste0('<a target=_blank href=', doi, '>', doi %>% str_remove(., "https://doi.org/"),'</a>'),
6499
journal = so %>% as.factor(),
@@ -68,7 +103,7 @@ pubs <- function(whois, openalex_id){
68103
) %>%
69104
select(!c(so, host_organization, publication_date)) %>%
70105
arrange(desc(`publication date`)) %>%
71-
DT::datatable(., escape = F, options = list(dom = 'tp'))
106+
DT::datatable(., escape = F, extensions = 'Buttons', options = list(dom = 'tp', buttons = c('copy', 'csv', 'excel')))
72107
}
73108

74109

_freeze/site_libs/dt-ext-buttons-1.13.6/css/buttons.dataTables.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)