Title: | Analyse Citation Data from Google Scholar |
---|---|
Description: | Provides functions to extract citation data from Google Scholar. Convenience functions are also provided for comparing multiple scholars and predicting future h-index values. |
Authors: | Guangchuang Yu [aut, cre] , James Keirstead [aut], Gregory Jefferis [aut] , Gordon Getzinger [ctb], Jorge Cimentada [ctb], Max Czapanskiy [ctb], Dominique Makowski [ctb] |
Maintainer: | Guangchuang Yu <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.2.4.002 |
Built: | 2024-10-29 03:16:53 UTC |
Source: | https://github.com/yulab-smu/scholar |
Get author rank in authors list.
author_position(authorlist, author)
author_position(authorlist, author)
authorlist |
list of publication authors |
author |
author's name to look for |
dataframe with author's position and normalized position (a normalized index, with 0 corresponding, 1 to last and 0.5 to the middle. Note that single authorship will be considered as last, i.e., 1).
Dominique Makowski
library(scholar) id <- "bg0BZ-QAAAAJ&hl" authorlist <- scholar::get_publications(id)$author author <- scholar::get_profile(id)$name author_position(authorlist, author)
library(scholar) id <- "bg0BZ-QAAAAJ&hl" authorlist <- scholar::get_publications(id)$author author <- scholar::get_profile(id)$name author_position(authorlist, author)
Compares the careers of multiple scholars based on their citation
histories. The scholar's career is defined by the number
of citations to his or her work in a given year (i.e. the bar
chart at the top of a scholar's profile). The function has an
career
option that allows users to compare scholars
directly, i.e. relative to the first year in which their
publications are cited.
compare_scholar_careers(ids, career = TRUE)
compare_scholar_careers(ids, career = TRUE)
ids |
a character vector of Google Scholar IDs |
career |
a boolean, should a column be added to the results measuring the year relative to the first citation year. Default = TRUE |
{ ## How do Richard Feynmann and Stephen Hawking compare? # Compare Feynman and Stephen Hawking ids <- c("B7vSqZsAAAAJ", "qj74uXkAAAAJ") df <- compare_scholar_careers(ids) }
{ ## How do Richard Feynmann and Stephen Hawking compare? # Compare Feynman and Stephen Hawking ids <- c("B7vSqZsAAAAJ", "qj74uXkAAAAJ") df <- compare_scholar_careers(ids) }
Compares the citation records of multiple scholars. This function compiles a data frame comparing the citations received by each of the scholar's publications by year of publication.
compare_scholars(ids, pagesize = 100)
compare_scholars(ids, pagesize = 100)
ids |
a vector of Google Scholar IDs |
pagesize |
an integer specifying the number of articles to fetch for each scholar |
a data frame giving the ID of each scholar and the total number of citations received by work published in a year.
{ ## How do Richard Feynmann and Stephen Hawking compare? ids <- c("B7vSqZsAAAAJ", "qj74uXkAAAAJ") df <- compare_scholars(ids) }
{ ## How do Richard Feynmann and Stephen Hawking compare? ids <- c("B7vSqZsAAAAJ", "qj74uXkAAAAJ") df <- compare_scholars(ids) }
This function converts first and middle names to initials
format_authors(string)
format_authors(string)
string |
a character vector of names |
Format publication list
format_publications(scholar.profile, author.name = NULL)
format_publications(scholar.profile, author.name = NULL)
scholar.profile |
scholar profile ID |
author.name |
name of author to be highlighted using bold font |
a vector of formated publications
R Thériault and modified by Guangchuang Yu
## Not run: library(scholar) format_publications("DO5oG40AAAAJ") ## End(Not run)
## Not run: library(scholar) format_publications("DO5oG40AAAAJ") ## End(Not run)
Gets the citation history of a single article
get_article_cite_history(id, article)
get_article_cite_history(id, article)
id |
a character string giving the id of the scholar |
article |
a character string giving the article id. |
a data frame giving the year, citations per year, and publication id
Gets the URL to the google scholar website of an article.
get_article_scholar_url(id, pubid)
get_article_scholar_url(id, pubid)
id |
a character string specifying the Google Scholar ID. |
pubid |
a character string specifying the article id. |
a String that contains the URL to the scholar website of the article
Gets the number of citations to a scholar's articles over the past nine years.
get_citation_history(id)
get_citation_history(id)
id |
a character string specifying the Google Scholar ID. If multiple ids are specified, only the first value is used and a warning is generated. |
This information is displayed as a bar plot at the top of a standard Google Scholar page and only covers the past nine years.
a data frame giving the number of citations per year to work by the given scholar
Gets the network of coauthors of a scholar
get_coauthors(id, n_coauthors = 5, n_deep = 1)
get_coauthors(id, n_coauthors = 5, n_deep = 1)
id |
a character string specifying the Google Scholar ID. If multiple ids are specified, only the first value is used and a warning is generated. |
n_coauthors |
Number of coauthors to explore. This number should usually be between 1 and 10 as choosing many coauthors can make the network graph too messy. |
n_deep |
The number of degrees that you want to go down the network. When |
Considering that scraping each publication for all coauthors is error prone, get_coauthors
grabs only the coauthors listed on the google scholar profile (on the bottom right of the profile),
not from all publications.
A data frame with two columns showing all authors and coauthors.
## Not run: library(scholar) coauthor_network <- get_coauthors('amYIKXQAAAAJ&hl') plot_coauthors(coauthor_network) ## End(Not run)
## Not run: library(scholar) coauthor_network <- get_coauthors('amYIKXQAAAAJ&hl') plot_coauthors(coauthor_network) ## End(Not run)
Found as Muhammad Qasim Pasta's solution here https://github.com/jkeirstead/scholar/issues/21
get_complete_authors(id, pubid, delay = 0.4, initials = TRUE)
get_complete_authors(id, pubid, delay = 0.4, initials = TRUE)
id |
a Google Scholar ID |
pubid |
a Publication ID from a given google Scholar ID |
delay |
average delay between requests. A delay is needed to stop Google identifying you as a bot |
initials |
if TRUE (default), first and middle names will be abbreviated |
a string containing the complete list of authors
Muhammad Qasim Pasta
Abram B. Fleishman
James H. Conigrave
Get journal ranking for a journal list.
get_journalrank(journals, max.distance = 0.05)
get_journalrank(journals, max.distance = 0.05)
journals |
a character list giving the journal list |
max.distance |
maximum distance allowed for a match between journal and journal list. Expressed either as integer, or as a fraction of the pattern length times the maximal transformation cost (will be replaced by the smallest integer not less than the corresponding fraction), or a list with possible components |
Journal ranking data.
Dominique Makowski and Guangchuang Yu
## Not run: library(scholar) id <- get_publications("bg0BZ-QAAAAJ&hl") impact <- get_journalrank(journals=id$journal) id <- cbind(id, impact) ## End(Not run)
## Not run: library(scholar) id <- get_publications("bg0BZ-QAAAAJ&hl") impact <- get_journalrank(journals=id$journal) id <- cbind(id, impact) ## End(Not run)
Calculate how many articles a scholar has published.
get_num_articles(id)
get_num_articles(id)
id |
a character string giving the Google Scholar ID |
an integer value (max 100)
Gets the number of distinct journals in which a scholar has published. Note that Google Scholar doesn't provide information on journals per se, but instead gives a title for the containing publication where applicable. So a journal here might actually be a journal, a book, a report, or some other publication outlet.
get_num_distinct_journals(id)
get_num_distinct_journals(id)
id |
a character string giving the Google Scholar id |
the number of distinct journals
Gets the number of top journals in which a scholar has published. The definition of a 'top journal' comes from Acuna et al. and the original list was based on the field of neuroscience. This function allows users to specify that list for themselves, or use the default Acuna et al. list.
get_num_top_journals(id, journals)
get_num_top_journals(id, journals)
id |
a character string giving a Google Scholar ID |
journals |
a character vector giving the names of the top journals. Defaults to Nature, Science, Nature Neuroscience, Proceedings of the National Academy of Sciences, and Neuron. |
DE Acuna, S Allesina, KP Kording (2012) Future impact: Predicting scientific success. Nature 489, 201-202. doi:10.1038/489201a.
Gets the year of the oldest article published by a given scholar.
get_oldest_article(id)
get_oldest_article(id)
id |
a character string giving the Google Scholar ID |
the year of the oldest article
Gets profile information for a researcher from Google Scholar. Each scholar profile page gives the researcher's name, affiliation, their homepage (if specified), and a summary of their key citation and publication availability metrics. The scholar ID can be found by searching Google Scholar at http://scholar.google.com.
get_profile(id)
get_profile(id)
id |
a character string specifying the Google Scholar ID. If multiple ids are specified, only the first value is used and a warning is generated. See the example below for how to profile multiple scholars. |
a list containing the scholar's name, affiliation, citations, impact and publication availability metrics, research interests, homepage and coauthors.
Metrics include:
total_cites combined citations to all publications
h_index the largest number h such that h publications each have at least h citations
i10_index the number of publications that each have at least 10 citations
available the number of publications that have a version online that can be read for free (though not necessarily reusable under an open access license)
not_available the number of publications only available behind a paywall
{ ## Gets profiles of some famous physicists ids <- c("xJaxiEEAAAAJ", "qj74uXkAAAAJ") profiles <- lapply(ids, get_profile) }
{ ## Gets profiles of some famous physicists ids <- c("xJaxiEEAAAAJ", "qj74uXkAAAAJ") profiles <- lapply(ids, get_profile) }
Gets the abstract for a publication id.
get_publication_abstract(id, pub_id, flush = FALSE)
get_publication_abstract(id, pub_id, flush = FALSE)
id |
a character string specifying the Google Scholar ID. |
pub_id |
a character string specifying the publication id. |
flush |
Whether or not to clear the cache |
a String that contains the abstract of the publication.
Gets the full data for a publication
get_publication_data_extended(id, pub_id, flush = FALSE)
get_publication_data_extended(id, pub_id, flush = FALSE)
id |
a character string specifying the Google Scholar ID. |
pub_id |
a character string specifying the publication id. |
flush |
Whether or not to clear the cache |
a list that contains the full data
Gets the full date for a publication
get_publication_date(id, pub_id, flush = FALSE)
get_publication_date(id, pub_id, flush = FALSE)
id |
a character string specifying the Google Scholar ID. |
pub_id |
a character string specifying the publication id. |
flush |
Whether or not to clear the cache |
a String that contains the publication date
Gets the PDF URL for a publication id.
get_publication_url(id, pub_id, flush = FALSE)
get_publication_url(id, pub_id, flush = FALSE)
id |
a character string specifying the Google Scholar ID. |
pub_id |
a character string specifying the publication id. |
flush |
Whether or not to clear the cache |
a String that contains the URL to the PDF of the publication.
Gets the publications of a specified scholar.
get_publications( id, cstart = 0, cstop = Inf, pagesize = 100, flush = FALSE, sortby = "citation" )
get_publications( id, cstart = 0, cstop = Inf, pagesize = 100, flush = FALSE, sortby = "citation" )
id |
a character string specifying the Google Scholar ID. If multiple IDs are specified, only the publications of the first scholar will be retrieved. |
cstart |
an integer specifying the first article to start counting. To get all publications for an author, omit this parameter. |
cstop |
an integer specifying the last article to process. |
pagesize |
an integer specifying the number of articles to fetch in one batch. It is recommended to leave the default value of 100 unless you experience time-out errors. Note this is not the total number of publications to fetch. |
flush |
should the cache be flushed? Search results are cached by default to speed up repeated queries. If this argument is TRUE, the cache will be cleared and the data reloaded from Google. |
sortby |
a character with value |
Google uses two id codes to uniquely reference a
publication. The results of this method includes cid
which
can be used to link to a publication's full citation history
(i.e. if you click on the number of citations in the main scholar
profile page), and pubid
which links to the details of the
publication (i.e. if you click on the title of the publication in
the main scholar profile page.)
a data frame listing the publications and their details. These include the publication title, author, journal, number, cites, year, and two id codes (see details).
Search for Google Scholar ID by name and affiliation
get_scholar_id(last_name = "", first_name = "", affiliation = NA)
get_scholar_id(last_name = "", first_name = "", affiliation = NA)
last_name |
Researcher last name. |
first_name |
Researcher first name. |
affiliation |
Researcher affiliation. |
Google Scholar ID as a character string.
get_scholar_id(first_name = "kristopher", last_name = "mcneill") get_scholar_id(first_name = "michael", last_name = "sander", affiliation = NA) get_scholar_id(first_name = "michael", last_name = "sander", affiliation = "eth") get_scholar_id(first_name = "michael", last_name = "sander", affiliation = "ETH Zurich") get_scholar_id(first_name = "michael", last_name = "sander", affiliation = "Mines") get_scholar_id(first_name = "james", last_name = "babler")
get_scholar_id(first_name = "kristopher", last_name = "mcneill") get_scholar_id(first_name = "michael", last_name = "sander", affiliation = NA) get_scholar_id(first_name = "michael", last_name = "sander", affiliation = "eth") get_scholar_id(first_name = "michael", last_name = "sander", affiliation = "ETH Zurich") get_scholar_id(first_name = "michael", last_name = "sander", affiliation = "Mines") get_scholar_id(first_name = "james", last_name = "babler")
see scholar-package
documentation for details about Scholar
session cookies.
get_scholar_resp(url, attempts_left = 5)
get_scholar_resp(url, attempts_left = 5)
url |
URL to fetch |
attempts_left |
The number of times to try and fetch the page |
an httr::response
object
httr::GET
Plot a network of coauthors
plot_coauthors(network, size_labels = 5)
plot_coauthors(network, size_labels = 5)
network |
A data frame given by |
size_labels |
Size of the label names |
a ggplot2
object but prints a plot as a side effect.
## Not run: library(scholar) coauthor_network <- get_coauthors('amYIKXQAAAAJ&hl') plot_coauthors(coauthor_network) ## End(Not run)
## Not run: library(scholar) coauthor_network <- get_coauthors('amYIKXQAAAAJ&hl') plot_coauthors(coauthor_network) ## End(Not run)
Predicts the h-index for a researcher each year for ten years into the future using Acuna et al's method (see source). The model was fit to data from neuroscience researchers with an h-index greater than 5 and between 5 to 12 years since publishing their first article. So naturally if this isn't you, then the results should be taken with a large pinch of salt.
predict_h_index(id, journals)
predict_h_index(id, journals)
id |
a character string giving the Google Scholar ID |
journals |
optional character vector of top
journals. See |
Since the model is calibrated to neuroscience researchers, it is entirely possible that very strange (e.g. negative) h-indices will be predicted if you are a researcher in another field. A warning will be displayed if the sequence of predicted h-indices contains a negative value or is non-increasing.
a data frame giving predicted h-index values in future
A scientist has an h-index of n if he or she publishes n papers with at least n citations each. Values returned are fractional so it's up to your own vanity whether you want to round up or down.
DE Acuna, S Allesina, KP Kording (2012) Future impact: Predicting scientific success. Nature 489, 201-202. doi:10.1038/489201a. Thanks to DE Acuna for providing the full regression coefficients for each year ahead prediction.
## Predict h-index of original method author ## Not run: id <- "DO5oG40AAAAJ" df <- predict_h_index(id) ## End(Not run)
## Predict h-index of original method author ## Not run: id <- "DO5oG40AAAAJ" df <- predict_h_index(id) ## End(Not run)
set scholar mirror
set_scholar_mirror(mirror = NULL)
set_scholar_mirror(mirror = NULL)
mirror |
compatible scholar mirror |
setting google scholar mirror
Guangchuang Yu