This documents provides a few line of codes to retrieve information from the google scholar API.
A few library are needed for this work, notably the scholar library that allows to call the google scholar API.
library(rmarkdown)
library(scholar) # To request data from google scholar.
library(tidyverse) # What do you do without?
library(hrbrthemes)
library(DT)
In this document we will study the publication of my Colleague Vincent Ranwez. His google scholar ID is WLaQnegAAAAJ&hl
# Define the google scholar id
id <- 'WLaQnegAAAAJ&hl' # Vincent Ranwez
Get his profile and print his name
# Make an object called l with all the basic info of this id: name, affiliation, # of cites, H index, homepage ...
l <- get_profile(id)
name=l$name
tmp=strsplit(name, " ") %>% unlist()
last_name = tmp[length(tmp)]
# Show the last name
last_name
## [1] "Ranwez"
This allows to reproduce the chart on the right of the google scholar page:
# get the info
citation = get_citation_history(id)
# plot it
citation %>%
ggplot( aes(x=year, y=cites)) +
geom_segment( aes(x=year, y=0, xend=year, yend=cites), color="grey") +
geom_point( size=4, col="#69b3a2") +
theme_ipsum()
Here is the detail of the publication:
data=get_publications(id)
## Warning: package 'bindrcpp' was built under R version 3.4.4
datatable(data, rownames = FALSE, options = list(pageLength = 4))
In total, 96 paper have been published in 63 different journals. Here is an overview of the most frequent journals.
table(tolower(data$journal)) %>% as.data.frame() %>% filter(Freq>1) %>% arrange(Freq) %>% mutate(Var1=factor(Var1, Var1)) %>%
ggplot(aes(x=Var1, y=Freq)) +
geom_bar(stat="identity", width=0.5, fill="#69b3a2") +
coord_flip() +
xlab("") +
theme_ipsum()
data %>%
ggplot(aes(x=year)) +
geom_bar( fill="#69b3a2") +
theme_ipsum()
The adjacency matrix of co-authors connection is a dataset example used in the data to viz project. Check the dedicated webpage for a few visualization made with this matrix.
A work by Yan Holtz
Yan.holtz.data@gmail.com