Project Status: Active – The project has reached a stable, usable state and is being actively developed. Build Status


minimal R version CRAN_Status_Badge packageversion


Last-changedate

knitr::opts_chunk$set(
  collapse = TRUE,
  cache = TRUE,
  comment = "#>",
  fig.path = "README-"
)

altmetric.com

rAltmetric


Travis-CI Build Status
AppVeyor Build Status
Coverage Status

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.

Installing the package 🛠

A stable version is available from CRAN. To install

install.packages('rAltmetric')
# or the 👷 dev version
devtools::install_github("ropensci/rAltmetric")

Quick Tutorial

Obtaining metrics

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

Data

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')

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.

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.

Further reading

📚 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},
  }



ropensci/rAltmetric documentation built on Dec. 30, 2021, 11:54 a.m.