Retrieving basic information

## Define the id for Richard Feynman
id <- 'B7vSqZsAAAAJ'

## Get his profile
l <- get_profile(id)

## Print his name and affliation
l$name
## [1] "Richard Feynman"
l$affiliation
## [1] "California Institute of Technology"
## Print his citation index
l$h_index
## [1] 63
l$i10_index
## [1] 96

Retrieving publications

get_publications() return a data.frame of publication records. It contains information of the publications, including title, author list, page number, citation number, publication year, etc..

The pubid is the article ID used by Google Scholar and the identifier that is used to retrieve the citation history of a selected publication.

## Get his publications (a large data frame)
p <- get_publications(id)
head(p, 3)
##                                    title
## 1        The Feynman lectures on physics
## 2 Quantum mechanics and path integration
## 3      Simulating physics with computers
##                                         author
## 1 RP Feynman, RB Leighton, M Sands, SB Treiman
## 2                         RP Feynman, AR Hibbs
## 3                                   RP Feynman
##                                        journal          number cites year
## 1                                Physics Today          17, 45 14835 1964
## 2                                  McGraw–Hill                 12141 1965
## 3 International journal of theoretical physics 21 (6), 467-488  6367 1982
##                                                                                                                                              cid
## 1 14769952204323476283,15649786516955137750,10144308693091404813,9010733094641920532,948993425682989482,13112633961799421939,3669163321259408309
## 2                                                                                  12549707430555464374,9986643540244834911,16081691140030299281
## 3                                                                                                                           10235205812612705711
##          pubid
## 1 u-x6o8ySG0sC
## 2 hMod-77fHWUC
## 3 d1gkVwhDpl0C

Retrieving citation data

## Get his citation history, i.e. citations to his work in a given year
ct <- get_citation_history(id)

## Plot citation trend
library(ggplot2)
ggplot(ct, aes(year, cites)) + geom_line() + geom_point()

Users can retrieve the citation history of a particular publication with get_article_cite_history().

## The following publication will be used to demonstrate article citation history
as.character(p$title[1])
## [1] "The Feynman lectures on physics"
## Get article citation history
ach <- get_article_cite_history(id, p$pubid[1])

## Plot citation trend
ggplot(ach, aes(year, cites)) +
    geom_segment(aes(xend = year, yend = 0), size=1, color='darkgrey') +
    geom_point(size=3, color='firebrick')

Comparing scholars

You can compare the citation history of scholars by fetching data with compare_scholars.

# Compare Feynman and Stephen Hawking
ids <- c('B7vSqZsAAAAJ', 'qj74uXkAAAAJ')

# Get a data frame comparing the number of citations to their work in
# a given year
cs <- compare_scholars(ids)

## remove some 'bad' records without sufficient information
cs <- subset(cs, !is.na(year) & year > 1900)
ggplot(cs, aes(year, cites, group=name, color=name)) + geom_line() + theme(legend.position="bottom")

## Compare their career trajectories, based on year of first citation
csc <- compare_scholar_careers(ids)
ggplot(csc, aes(career_year, cites, group=name, color=name)) + geom_line() + geom_point() +
    theme(legend.position=c(.2, .8))