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 provenance rows for the works Altmetric answered for.
Works whose lookup failed (other than "not found") keep missing values
and are reported in a warning of class scimapR_altmetric_unchecked
with their work_ids.