Retrieves Altmerics Data for Any Published Paper from 'Altmetric.com'

Provides a programmatic interface to the citation information and alternate metrics provided by 'Altmetric'. Data from Altmetric allows researchers to immediately track the impact of their published work, without having to wait for citations. This allows for faster engagement with the audience interested in your work. For more information, visit < https://www.altmetric.com/>.


Linux build:
Windows build:

altmetric.com

This package provides a way to programmatically retrieve altmetric data from altmetric.com for any publication with the appropriate identifer. The package is really simple to use and only has two major functions: One (altmetrics()) to download metrics and another (altmetric_data()) to extract the data into a data.frame. It also includes generic S3 methods to plot/print metrics for any altmetric object.

Questions, features requests and issues should go here. General comments to karthik.ram@gmail.com.

Installing the package

A stable version is available from CRAN. To install

install.packages('rAltmetric')
# If you don't already have the devtools library, first run 
install.packages('devtools')
 
# then install the package 
library(devtools)
install_github('rAltmetric''ropensci')

Quick Tutorial

There was a recent paper by Acuna et al that received a lot of attention on Twitter. What was the impact of that paper?

library(rAltmetric)
acuna <- altmetrics('10.1038/489201a')
Altmetrics on: "Future impact: Predicting scientific success" with doi 10.1038/489201a (altmetric_id: 942310) published in Nature.
  provider count
1    Feeds     9
2  Google+     1
3    Cited   174
4   Tweets   157
5 Accounts   167
 

To obtain the metrics in tabular form for further processing, run any object of class altmetric through altmetric_data() to get data that can easily be written to disk as a spreadsheet.

> altmetric_data(acuna)
                                         title
1 Future impact: Predicting scientific success
              doi   nlmid            altmetric_jid     issns
1 10.1038/489201a 0410462 4f6fa50a3cf058f610003160 0028-0836
  journal altmetric_id schema is_oa cited_by_feeds_count
1  Nature       942310  1.5.4 FALSE                  173
  cited_by_gplus_count cited_by_posts_count
1                  173                  173
  cited_by_tweeters_count cited_by_accounts_count   score
1                     156                     166 184.598
  mendeley connotea citeulike pub sci com doc
1        0        0        11  62  84   6   8
                                                                url
1 http://www.nature.com/nature/journal/v489/n7415/full/489201a.html
    added_on published_on subjects scopus_subjects
1 1347471425   1347404400  science         General
  last_updated readers_count X1 count_all count_journal
1   1348828350            11  1    754555         13972
  count_similar_age_1m count_similar_age_3m
1                22408                56213
  count_similar_age_journal_1m count_similar_age_journal_3m
1                          508                         1035
  rank_all rank_journal rank_similar_age_1m
1   754043        13759               22339
  rank_similar_age_3m rank_similar_age_journal_1m
1               56074                         459
  rank_similar_age_journal_3m pct_all pct_journal
1                         947   99.93       98.48
  pct_similar_age_1m pct_similar_age_3m
1              99.69              99.75
  pct_similar_age_journal_1m pct_similar_age_journal_3m
1                      90.35                      91.50
                                              details_url
1 http://www.altmetric.com/details.php?citation_id=942310

You can save these data into a clean spreadsheet format:

acuna_data <- altmetric_data(acuna)
write.csv(acuna_datafile = 'acuna_altmetrics.csv')

For any altmetric object you can quickly plot the stats with a generic plot function. The plot overlays the altmetric badge and the score on the top right corner. If you prefer a customized plot, create your own with the raw data generated from almetric_data()

> plot(acuna)

Gathering metrics for many DOIs

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.

# Be sure to update the path if the example csv is not in your working dir 
doi_data <- read.csv('dois.csv'header = TRUE)
 
> doi_data
                         doi
1        10.1038/nature09210
2    10.1126/science.1187820
3 10.1016/j.tree.2011.01.009
4             10.1086/664183
 
 
library(plyr)
# First, let's retrieve the metrics. 
raw_metrics <- llply(doi_data$doifunction(x) altmetrics(doi = x).progress = 'text')
# Now let's pull the data together. 
metric_data <- ldply(raw_metricsaltmetric_data)
# Finally we save this to a spreadsheet for further analysis/vizualization. 
write.csv(metric_datafile = "metric_data.csv")

To cite package ‘rAltmetric’ in publications use:

  Karthik Ram (2012). rAltmetric: Retrieves altmerics data for any
  published paper from altmetrics.com. R package version 0.3.
  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 = {2012},
    note = {package version 0.3},
    url = {http://CRAN.R-project.org/package=rAltmetric},
  }

News

  • Several bug fixes and documentation updates
  • Removed hard dependencies and moved them to imports
  • Minor bug fixes
  • Initial release to CRAN

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("rAltmetric")

0.7.0 by Karthik Ram, 5 months ago


https://github.com/ropensci/rAltmetric


Report a bug at https://github.com/ropensci/rAltmetric/issues


Browse source code at https://github.com/cran/rAltmetric


Authors: Karthik Ram [aut, cre]


Documentation:   PDF Manual  


Task views:


MIT + file LICENSE license


Imports httr, jsonlite, rlist

Suggests dplyr, testthat, covr, knitr, magrittr, purrr, rmarkdown


See at CRAN