This repository has been archived by the owner on Jun 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
README.Rmd
130 lines (90 loc) · 4.35 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
---
output: github_document
---
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
[![Build Status](https://travis-ci.org/ropensci/rAltmetric.svg?branch=master)](https://travis-ci.org/ropensci/rAltmetric)
---
[![minimal R version](https://img.shields.io/badge/R%3E%3D-3.3.2-6666ff.svg)](https://cran.r-project.org/)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/rAltmetric)](https://cran.r-project.org/package=rAltmetric)
[![packageversion](https://img.shields.io/badge/Package%20version-0.7.9000-orange.svg?style=flat-square)](commits/master)
---
[![Last-changedate](https://img.shields.io/badge/last%20change-`r gsub('-', '--', Sys.Date())`-yellowgreen.svg)](/commits/master)
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
cache = TRUE,
comment = "#>",
fig.path = "README-"
)
```
![altmetric.com](https://github.com/ropensci/rAltmetric/raw/master/altmetric_logo_title.png)
# rAltmetric
![](http://cranlogs.r-pkg.org/badges/rAltmetric)
[![Travis-CI Build Status](https://travis-ci.org/ropensci/rAltmetric.svg?branch=master)](https://travis-ci.org/ropensci/rAltmetric)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/ropensci/rAltmetric?branch=master&svg=true)](https://ci.appveyor.com/project/ropensci/rAltmetric)
[![Coverage Status](https://img.shields.io/codecov/c/github/ropensci/rAltmetric/master.svg)](https://codecov.io/github/ropensci/rAltmetric?branch=master)
This package provides a way to programmatically retrieve altmetrics from various publication types (books, newsletters, articles, peer-reviewed papers and more) from [altmetric.com](http://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](https://github.com/ropensci/rAltmetric/issues/).
# Installing the package 🛠
A stable version is available from CRAN. To install
```r
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](http://www.nature.com/news/2010/100616/full/465860a.html) that received a lot of attention on Twitter. What was the impact of that paper?
```{r}
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.
```{r}
altmetric_data(acuna)
```
You can save these data into a clean spreadsheet format:
```r
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.
```{r}
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
* [Metrics: Do metrics matter?](http://www.nature.com/news/2010/100616/full/465860a.html)
* [The altmetrics manifesto](http://altmetrics.org/manifesto/)
📚 To cite package `rAltmetric` in publications use:
```r
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},
}
```
[![](http://ropensci.org/public_images/github_footer.png)](http://ropensci.org)