Title: | Get and Show Personal 'Google Scholar' Profile |
Version: | 0.1.7 |
Maintainer: | Shixiang Wang <w_shixiang@163.com> |
Description: | Provides functions to get personal 'Google Scholar' profile data from web API and show it in table or figure format. |
License: | MIT + file LICENSE |
URL: | https://github.com/ShixiangWang/tinyscholar |
BugReports: | https://github.com/ShixiangWang/tinyscholar/issues |
Imports: | curl, dplyr, ggplot2, gt, jsonlite, magrittr, purrr, rlang (≥ 0.1.2), rvest (≥ 1.0.0), stringr, xml2, R.utils |
Suggests: | knitr, rmarkdown, roxygen2 |
VignetteBuilder: | knitr |
Encoding: | UTF-8 |
RoxygenNote: | 7.2.0 |
NeedsCompilation: | no |
Packaged: | 2022-08-09 14:39:08 UTC; wsx |
Author: | Shixiang Wang |
Repository: | CRAN |
Date/Publication: | 2022-08-09 15:30:02 UTC |
Pipe operator
Description
See magrittr::%>%
for details.
Usage
lhs %>% rhs
Show Scholar Profile Plot.
Description
Show Scholar Profile Plot.
Usage
scholar_plot(
profile,
bar_width = 0.5,
add_total = FALSE,
add_text = TRUE,
title_citations = NULL,
title_publications = NULL,
caption_citations = paste("Update:", Sys.Date()),
caption_publications = caption_citations
)
Arguments
profile |
Result from tinyscholar. |
bar_width |
bar width. |
add_total |
If |
add_text |
If |
title_citations |
Title for plot |
title_publications |
Title for plot |
caption_citations |
Caption for plot |
caption_publications |
Caption for plot |
Value
a length-2 list of ggplot2::ggplot object.
See Also
Search Google Scholar Highly Related Papers or Author
Description
Search Google Scholar Highly Related Papers or Author
Usage
scholar_search(
keyword,
is_author = TRUE,
server_url = "https://api.scaleserp.com",
server_key = NULL
)
Arguments
keyword |
A keyword, can be author name, e.g. "Shixiang Wang". |
is_author |
Default is |
server_url |
Server URL, here I use Scale SERP API. |
server_key |
Key for searching data (multiple is acceptable), you can obtain it from URL above. If not set, use personal key from Shixiang. Total 125x2 free searches per month. |
Value
A data.frame
or a list
.
Examples
x <- scholar_search("Shixiang Wang")
x
x <- scholar_search("Shixiang Wang", is_author = FALSE)
if (!is.null(x)) {
x$gt
}
Show Scholar Profile Table
Description
Show Scholar Profile Table
Usage
scholar_table(
profile,
as_raw_html = FALSE,
title_citations = "Citations",
title_publications = "Publications",
caption_citations = gt::md(paste("**Update**:", Sys.Date())),
caption_publications = caption_citations
)
Arguments
profile |
Result from tinyscholar. |
as_raw_html |
If |
title_citations |
Title for table |
title_publications |
Title for table |
caption_citations |
Caption for table |
caption_publications |
Caption for table |
Value
a length-2 list of gt::gt/html
object.
See Also
Tidy eval helpers
Description
-
sym()
creates a symbol from a string andsyms()
creates a list of symbols from a character vector. -
enquo()
andenquos()
delay the execution of one or several function arguments.enquo()
returns a single quoted expression, which is like a blueprint for the delayed computation.enquos()
returns a list of such quoted expressions. -
expr()
quotes a new expression locally. It is mostly useful to build new expressions around arguments captured withenquo()
orenquos()
:expr(mean(!!enquo(arg), na.rm = TRUE))
. -
as_name()
transforms a quoted variable name into a string. Supplying something else than a quoted variable name is an error.That's unlike
as_label()
which also returns a single string but supports any kind of R object as input, including quoted function calls and vectors. Its purpose is to summarise that object into a single label. That label is often suitable as a default name.If you don't know what a quoted expression contains (for instance expressions captured with
enquo()
could be a variable name, a call to a function, or an unquoted constant), then useas_label()
. If you know you have quoted a simple variable name, or would like to enforce this, useas_name()
.
To learn more about tidy eval and how to use these tools, visit https://dplyr.tidyverse.org/articles/programming.html and the Metaprogramming section of Advanced R.
Get Google Scholar Profile
Description
Get Google Scholar Profile
Usage
tinyscholar(
id,
sortby_date = FALSE,
use_cache = TRUE,
cache_dir = file.path(tempdir(), "tinyscholar")
)
Arguments
id |
Your google scholar identifier. You can find it in the URL of your google scholar profile. |
sortby_date |
Logical. If |
use_cache |
If |
cache_dir |
A directory path. |
Value
a Profile
object with list structure.
Examples
# Put one unique Scholar ID from Google Scholar
r <- tinyscholar("FvNp0NkAAAAJ")
r
if (!is.null(r)) {
tb <- scholar_table(r)
tb$citations
tb$publications
pl <- scholar_plot(r)
pl$citations
pl$publications
}