This is a short vignette explaning how to use rAltmetric. Altmetric is a private company that collects metrics that go far beyond traditional citations. It collects mentions on various social media to provide a more complete picture of the impact of a scholarly publication.

The core functionality of the package is captured in two functions:

altmetrics - Returns data for a valid identifier such as an altmetric object id, a pubmed ID, an arxiv identifier, a doi, ISBN and so on.
altmetric_data - takes the output of the previous function and returns a tidy data.frame

The package can be used to parse a whole batch of identifiers at once.

e.g.

## Warning: package 'magrittr' was built under R version 4.0.3
## 
## Attaching package: 'purrr'
## The following object is masked from 'package:magrittr':
## 
##     set_names
ids <- list(
  "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 <- map_df(ids, alm)
# This results in a data.frame with one row per identifier.

You can now see some citation data for these papers.

## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
knitr::kable(results %>% select(title, doi,  starts_with("cited")))
title doi cited_by_fbwalls_count cited_by_feeds_count cited_by_msm_count cited_by_policies_count cited_by_posts_count cited_by_tweeters_count cited_by_accounts_count cited_by_rh_count
Coupled dynamics of body mass and population growth in response to environmental change 10.1038/nature09210 1 7 1 1 12 2 12 NA
Stochastic Community Assembly Causes Higher Biodiversity in More Productive Environments 10.1126/science.1187820 NA 1 NA 1 8 5 8 1
Why intraspecific trait variation matters in community ecology 10.1016/j.tree.2011.01.009 NA 3 NA NA 12 7 10 NA
Enemies Maintain Hyperdiverse Tropical Forests 10.1086/664183 NA NA NA NA 3 2 3 1