knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
The goal of tinyscholar is to provide a simple way to get and show Google scholar profile.
You can install the released version of tinyscholar from CRAN with:
install.packages("tinyscholar")
And the development version from GitHub with:
# install.packages("devtools") devtools::install_github("ShixiangWang/tinyscholar") # devtools::install_git("https://gitee.com/ShixiangWang/tinyscholar")
Here I will use my profile as an example.
library(tinyscholar)
Firstly, you need to get your Google scholar ID from URL of your Google scholar profile or by running the following function with a keyword:
scholar_search("Shixiang Wang") #> Searching author Shixiang Wang #> Using API server: https://api.scaleserp.com #> Using Shixiang's personal API key, only 125 free searches per month for all packages users #> Search times used: 38 #> Search times left: 87 #> id #> 1 FvNp0NkAAAAJ #> desc #> 1 Wang, Shixiang (王诗翔)ShanghaiTech. UniversityVerified email at shanghaitech.edu.cnCited by 127
Copy your ID and go to the next step.
Then you can use function tinyscholar()
to get the tidy data, which is a list of two data.frame
with added profile
class.
profile <- tinyscholar("FvNp0NkAAAAJ") str(profile, max.level = 1)
You can use this data in your way. The following parts provide two simple ways to show the profile.
Table is the best way to show the scholar profile. Tinyscholar uses gt package to generate tables which can be easily modified.
tb <- scholar_table(profile) tb$citations tb$publications
Similarly, you can show numeric data with ggplot2 package.
pl <- scholar_plot(profile) pl$citations pl$publications
R package scholar is a more comprehensive package to get and visualize the Google scholar profile. However, tinyscholar is lightweight and not limited in China.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.