Code
# les papiers
paper=read_csv("data/all_paper_umr_20260717.csv")
rosette=read_csv("data/rosette_hal_formid_nom.csv")# les papiers
paper=read_csv("data/all_paper_umr_20260717.csv")
rosette=read_csv("data/rosette_hal_formid_nom.csv")La base HAL de l’UMR au 17/07/2026 contient 4389 Documents, pour 1638 auteurs.
DT::datatable(paper,options=list(pageLength = 5))paper %>%
download_this(
output_name = "all_paper_umr_20260717",
output_extension = ".csv",
button_label = "Télécharger la base HAL (CSV ;)",
button_type = "primary",
has_icon = TRUE,
icon = "fa fa-download"
)Comme on peut le voir ici, il y aussi une colonne nom_simple. Il s’agit d’un identifiant unique pour toutes les personnes dans la base des productions de l’UMR, qu’elles soient membre ou non du Labo. Si vous ouvrez le code plus haut, un fichier rosette a également été chargé. Il permet de faire le lien entre les différents identifiants hal et l’identifiant unique nom_simple.
Juste pour vous montrer, vous trouverez ci-dessous un échantillon ici pris aléatoirement de membres du labo entre 2020 et 2025, avec plusieurs identifiant hal. C’était un casse tête à gérer.
sample_people=rosette %>% count(nom_simple) %>%
filter(nom_simple %in% umr_simple$nom_simple) %>%
arrange(desc(n)) %>%
filter(n>3) %>% pull(nom_simple) %>% sample(3)
rosette %>%
filter(nom_simple %in% sample_people) %>%
arrange(nom_simple) %>%
datatable(options=list(pageLength = nrow(.)))rosette %>% count(nom_simple,name = "Nombre d'identifiants") %>%
arrange(desc(`Nombre d'identifiants`))%>%
datatable(options=list(pageLength = 5))url_doc="https://api.archives-ouvertes.fr/ref/doctype"
type_doc=fromJSON(url_doc)
type_doc=type_doc$response$result$doc$str
type_doc=do.call("rbind.data.frame",type_doc) %>%
setNames(c("docType_s","type"))
paper_type=paper %>%
dplyr::select(halId_s,docType_s) %>%
distinct()
count_type=paper_type %>%
count(docType_s) %>%
left_join(type_doc) %>%
arrange(desc(n)) %>%
mutate(type=ifelse(n<10,"Autre",type)) %>%
mutate(type=ifelse(docType_s=="OTHER","Autre",type)) %>%
mutate(type=ifelse(docType_s=="COMM" |
docType_s=="POSTER" |
docType_s =="PROCEEDINGS","Communication/Poster",
type)) %>%
mutate(type2=gsub(x = type,"[/]","\n"))%>%
mutate(type2=gsub(x = type2,",","\n")) %>%
mutate(type2=gsub(x = type2," ou","\nou"))count_type %>%
group_by(type) %>%
summarise(n=sum(n)) %>%
arrange(desc(n)) %>%
ggplot(aes(x=reorder(type,n),y=n))+
geom_col()+
geom_label(aes(label=n))+
theme_bw(base_size=12)+
theme(axis.text.x = element_text(angle=45,hjust=1))+
xlab("")+
ylab("Nombre de production")
ggsave("figures/fig_4.svg",device = svglite::svglite)
count_type %>%
dplyr::select(-type2) %>%
download_this(
output_name = "labo_production",
output_extension = ".csv",
button_label = "Télécharger la base HAL (CSV ;)",
button_type = "primary",
has_icon = TRUE,
icon = "fa fa-download"
)Ici on ne va prendre que le premier champs de chaque membre du labo. Si deux personnes d’un même champs ont publié ensemble, cette publi vaudra 1 dans le champs. Si ces personnes sont d’un champs différent, chaque champs aura +1.
paper_champ=paper %>%
dplyr::select(halId_s,nom_simple,producedDateY_i,docType_s) %>%
inner_join(umr_simple,by="nom_simple")
count_type_champ=paper_champ %>%
dplyr::select(halId_s,champ1,docType_s) %>%
distinct() %>%
count(champ1,docType_s) %>%
inner_join(count_type %>% dplyr::select(-n),by="docType_s") %>%
inner_join(rosette_champs,by=c("champ1"="champs"))
tot_publi_champ=count_type_champ %>%
group_by(label_champs) %>%
summarise(nb=sum(n))count_type_champ %>%
group_by(type,label_champs) %>%
summarise(n=sum(n)) %>%
arrange(desc(n)) %>%
ggplot(aes(x=reorder(type,n),y=n))+
geom_col()+
geom_label(aes(label=n))+
theme_bw(base_size=16)+
theme(axis.text.x = element_text(angle=45,hjust=1))+
geom_text(data=tot_publi_champ,
aes(x=-Inf,y=Inf,label=paste0("Total=",nb)),
hjust = -1,
vjust=3)+
# vjust=0)+
xlab("")+
ylab("Nombre de production")+
facet_wrap(~label_champs,scale="free_y",ncol=2)
ggsave("figures/fig_5.svg",device = svglite::svglite)
count_type_champ %>%
dplyr::select(-type2) %>%
download_this(
output_name = "labo_production_champs",
output_extension = ".csv",
button_label = "Télécharger la base HAL (CSV ;)",
button_type = "primary",
has_icon = TRUE,
icon = "fa fa-download"
)people_hors_champs=paper_champ %>% filter(champ1=="A") %>% left_join(type_doc)
people_hors_champs %>% count(nom_simple) %>% arrange(desc(n)) %>%
datatable(options=list(pageLength = 5))people_hors_champs %>% count(type,nom_simple) %>% arrange(desc(n)) %>%
group_by(nom_simple) %>%
mutate(tot=sum(n)) %>%
ungroup() %>%
ggplot()+
geom_col(aes(x=reorder(nom_simple,tot),y=n,fill=type))+
theme_bw()+
# scale_fill_brewer(palette="Set2")+
theme(axis.text.x = element_text(angle=45,hjust=1))
ggsave("figures/fig_6.svg",device = svglite::svglite)sel_type=count_type %>%
group_by(type) %>%
summarise(nb=sum(n))%>%
filter(nb>100) %>% pull(type)
count_type2=count_type %>% filter(type %in% sel_type) %>%
dplyr::select(-n)
nb_coauth=paper %>% count(halId_s,name="nb_coauth")
nb_coauth_champ=paper %>%
dplyr::select(halId_s,nom_simple,docType_s) %>%
inner_join(nb_coauth) %>% # nombre de coauteurs par articles
inner_join(umr_simple %>% dplyr::select(nom_simple,champ1),
by="nom_simple") %>% # on récupère les champs
left_join(rosette_champs,by=c("champ1"="champs"))%>%
dplyr::select(-nom_simple) %>%
distinct()
nb_coauth_champ_article=nb_coauth_champ %>%
inner_join(count_type2,by="docType_s")
stat_coauth_champs_art=nb_coauth_champ_article %>%
group_by(label_champs,type) %>%
summarise(nb_prod=n(),
mean=mean(nb_coauth),
median=median(nb_coauth),
sd=sd(nb_coauth),
min=min(nb_coauth),
max=max(nb_coauth)) %>%
ungroup()
stat_coauth_champ=nb_coauth_champ %>%
group_by(label_champs) %>%
summarise(nb_prod=n(),
mean=mean(nb_coauth),
median=median(nb_coauth),
sd=sd(nb_coauth),
min=min(nb_coauth),
max=max(nb_coauth)) %>%
ungroup() # summarise(nb=sum(n))
nb_coauth_champ_article %>%
ggplot(aes(y=nb_coauth,x=type))+
geom_boxplot(aes(fill=type),outliers = FALSE)+
facet_wrap(~label_champs,scale="free_y")+
ggtitle("nombre de co-auteurs")+
ylab("Nombre de co-auteurs")+
xlab("")+
theme_bw(base_size = 14)+
theme(axis.text.x = element_text(angle=45,hjust=1),
legend.position="bottom",
legend.direction = "horizontal")
ggsave("figures/fig_7.svg",device = svglite::svglite)nb_coauth_champ_article %>%
ggplot(aes(y=nb_coauth,x=label_champs))+
geom_boxplot(aes(fill=label_champs),outliers = FALSE)+
facet_wrap(~type,scale="free_y")+
ggtitle("nombre de co-auteurs par type de document")+
theme_bw(base_size = 16)+
theme(legend.position = "none",
axis.text.x = element_text(angle=45,hjust=1))+
ylab("Nombre de coauteurs")+
xlab("")
ggsave("figures/fig_8.svg",device = svglite::svglite)stat_coauth_champ %>%
# dplyr::select(-type2) %>%
download_this(
output_name = "stat_production_champs",
output_extension = ".csv",
button_label = "stats auteurs par champs",
button_type = "primary",
has_icon = TRUE,
icon = "fa fa-download"
)stat_coauth_champs_art %>%
# dplyr::select(-type2) %>%
download_this(
output_name = "stat_production_champs_prod",
output_extension = ".csv",
button_label = "stats auteurs par champs & type de production",
button_type = "primary",
has_icon = TRUE,
icon = "fa fa-download"
)