knitr::opts_chunk$set( collapse = TRUE, cache = TRUE, comment = "#>", fig.path = "README-" )
This package provides a way to programmatically retrieve altmetrics from various publication types (books, newsletters, articles, peer-reviewed papers and more) from altmetric.com. The package is really simple to use and only has two major functions:
- altmetrics
- Pass it a doi, isbn, uri, arxiv id or other to get metrics
- altmetric_data
Pass it the results from the previous call to get a tidy data.frame
Questions, features requests and issues should go here.
A stable version is available from CRAN. To install
install.packages('rAltmetric') # or the 👷 dev version devtools::install_github("ropensci/rAltmetric")
There was a 2010 paper by Acuna et al that received a lot of attention on Twitter. What was the impact of that paper?
library(rAltmetric) acuna <- altmetrics(doi = "10.1038/465860a") acuna
To obtain the metrics in tabular form for further processing, run any object of class altmetric
through altmetric_data()
to get a data.frame
that can easily be written to disk.
altmetric_data(acuna)
You can save these data into a clean spreadsheet format:
acuna_data <- altmetric_data(acuna) readr::write_csv(acuna_data, path = 'acuna_altmetrics.csv')
For a real world use-case, one might want to get metrics on multiple publications. If so, just read them from a spreadsheet and llply
through them like the example below.
library(rAltmetric) library(magrittr) library(purrr) ids <- list(c( "10.1038/nature09210", "10.1126/science.1187820", "10.1016/j.tree.2011.01.009", "10.1086/664183" )) alm <- function(x) altmetrics(doi = x) %>% altmetric_data() results <- pmap_df(ids, alm) # This results in a data.frame with one row per identifier.
📚 To cite package rAltmetric
in publications use:
Karthik Ram (2017). rAltmetric: Retrieves altmerics data for any published paper from altmetrics.com. R package version 0.7. http://CRAN.R-project.org/package=rAltmetric A BibTeX entry for LaTeX users is @Manual{, title = {rAltmetric: Retrieves altmerics data for any published paper from altmetrics.com}, author = {Karthik Ram}, year = {2017}, note = {R package version 0.7}, url = {http://CRAN.R-project.org/package=rAltmetric}, }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.