Jihong: Number Publications by Year
Year
Number of publications
Cumulative Number Number
0
5
10
15
20
25
30
2018
2018.5
2019
2019.5
2020
2020.5
2021
2021.5
2022
2022.5
2023
2023.5
2024
2024.5
Figure 1 shows the number of citation by year.
---
title: "Publications | Jihong Zhang"
sidebar: false
toc: false
execute:
eval: true
echo: false
format:
html:
code-tools: true
code-fold: false
comments: false
---
```{r setup}
#| message: false
library(scholar)
library(ggplot2)
library(dplyr)
library(stringr)
library(htmltools)
```
```{r compile_data}
#| include: false
# "MbRDAB4AAAAJ" is my Google scholar id, which can be found in your Google scholar URL address
# For example, my Google scholar webpage has the URL "https://scholar.google.com/citations?user=MbRDAB4AAAAJ&hl=zh-CN"
# Text after "user=" is your ID
# get_publication_url(id = "MbRDAB4AAAAJ", pub_id = pubs$pubid[2])
pubs <- scholar::get_publications("MbRDAB4AAAAJ", sortby = "year")
pubs <- pubs |>
mutate(
URL = get_article_scholar_url(id = "MbRDAB4AAAAJ", pubid = pubid)
) |>
arrange(desc(year)) |>
mutate(
pubs_formated = paste0(str_replace(format_publications("MbRDAB4AAAAJ"), "Zhang, J.", "**Zhang, J.**"))
) |>
select(title:number, year, pubs_formated, URL)
```
```{r total_paper}
## Dynamically display the histogram of number of publications
pubs_count_byyear <- pubs |>
count(year) |>
arrange(desc(year)) |>
mutate(n_cum = cumsum(n))
# total_publication <- paste0("In total, I've published ", nrow(pubs), " papers. ")
# p(total_publication)
```
```{r dynamic_plot}
library(dygraphs)
pubs_count_ts <- pubs_count_byyear |> arrange(year) |> mutate(n_cum = cumsum(n))
## Refer to https://rstudio.github.io/dygraphs/
dygraph(pubs_count_ts,
xlab = "Year",
main = "Jihong: Number Publications by Year") |>
dyAxis("y", label = "Number of publications", valueRange = c(0, max(pubs_count_ts$n_cum) + 5)) |>
dySeries("n_cum", label = "Cumulative Number") |>
dySeries("n", label = "Number") |>
dyOptions(colors = RColorBrewer::brewer.pal(3, "Set2")) |>
dyOptions(axisLineWidth = 1.5, fillGraph = TRUE, drawPoints = TRUE, pointSize = 3) |>
dyHighlight(highlightCircleSize = 5,
highlightSeriesBackgroundAlpha = 0.4,
hideOnMouseOut = FALSE)
```
@fig-citation shows the number of citation by year.
## {{< fa pencil >}} Journal Articles
::: nice-paragraph
```{r}
#| echo: false
#| results: asis
#| warning: false
# https://github.com/sonsoleslp/sonsoleslp.github.io/blob/main/publications.qmd
pubs_formated <- pubs$pubs_formated
for (y in 1:nrow(pubs_count_byyear)) {
print(h3(pubs_count_byyear$year[y]))
index_min = ifelse(y == 1, 1, pubs_count_byyear$n_cum[y-1] + 1)
index_max = pubs_count_byyear$n_cum[y]
for (i in index_min:index_max) {
cat("\n\n")
print(tags$ul(pubs_formated[i], a(class = "fa-brands fa-google-scholar fa-sm", href = pubs$URL[i], style="color: #74C0FC;")) , style="padding-left: 3rem")
}
}
```
:::
## Citations
```{r}
#| label: fig-citation
#| fig-cap: "Histogram of Citations by Year"
cit <- get_citation_history('MbRDAB4AAAAJ') # the Google Scholar ID
ggplot(cit,aes(x=year,y=cites))+
geom_bar(stat='identity')+
geom_label(aes(label = cites)) +
theme_classic()+
xlab('Year of citation')+
ylab('Google Scholar\n cites')+
annotate('text',label=format(Sys.time(), "%Y-%m-%d %H:%M:%S %Z"),x=-Inf,y=Inf,vjust=1.5,hjust=-0.05,size=3,colour='gray')
```