-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
68 lines (43 loc) · 1.64 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
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
message = FALSE
)
```
# openlibraryR <img src = "man/figures/openlibraryR_sm.png" width = "180px" align = "right" />
[![Build Status](https://travis-ci.com/walkerkq/openlibraryR.svg?branch=main)](https://travis-ci.com/walkerkq/openlibraryR)
openlibraryR is an R package that provides a simple wrapper for the [Open Library API](https://openlibrary.org/dev/docs/api/books).
[Open Library](https://openlibrary.org) is an initiative of the [Internet Archive](https:://archive.org), a 501(c)(3) non-profit, building a digital library of Internet sites and other cultural artifacts in digital form.
Hex sticker icon by [mangsaabguru](https://www.flaticon.com/authors/mangsaabguru).
## Installation
You can install the development version of openlibraryR from Github:
```{r, eval = FALSE}
devtools::install_github("walkerkq/openlibraryR")
```
## Getting Started
You do not need an account or key to access the Open Library API. There is only method provided which returns book details from an ISBN (International Standard Book Number).
```{r}
my_book <- openlibraryR::get_books(book_id = '0486282112')
str(my_book)
```
Use `tidyr::unnest` to access the various nested data.
```{r}
library(dplyr)
my_book %>%
select(authors) %>%
tidyr::unnest(authors,
names_sep = '_')
my_book %>%
select(identifiers) %>%
tidyr::unnest(identifiers)
my_book %>%
select(subject_people) %>%
tidyr::unnest(subject_people,
names_sep = '_')
```