Look up DOIs in the corpus via the
Altmetric API and add attention scores,
Mendeley reader counts, and social media metrics to the works table.
This enricher is idempotent: re-running it updates existing Altmetric data rather than duplicating it.
Usage
sm_enrich_altmetric(
corpus,
api_key = Sys.getenv("ALTMETRIC_API_KEY"),
verbose = TRUE,
call = rlang::caller_env()
)Value
An sm_corpus object with added altmetric_score,
mendeley_readers, twitter_count, and news_count columns in the
works table, plus new provenance rows.
Examples
if (FALSE) { # \dontrun{
corpus <- sm_example_corpus()
corpus <- sm_enrich_altmetric(corpus)
} # }