-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
76 lines (50 loc) · 3.6 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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
options(tibble.print_min = 5, tibble.print_max = 5, tibble.max_extra_cols = 0)
```
# mortyr <img src='man/figures/logo.png' align="right" height="150" /></a>
<!-- badges: start -->
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active/)
[![Travis build status](https://travis-ci.org/MikeJohnPage/mortyr.svg?branch=master)](https://travis-ci.org/MikeJohnPage/mortyr/)
<!-- badges: end -->
## Overview
mortyr is an R wrapper to the [The Rick and Morty API](https://rickandmortyapi.com/)
and the most rickdiculous package in the R-verse. Use it to return information
about your favourite characters, locations, and episodes from the show.
## Installation
You can install the released version of mortyr from CRAN:
```r
install.packages("mortyr")
```
Or install the development version from GitHub with:
``` r
# install.packages("devtools")
devtools::install_github("MikeJohnPage/mortyr")
```
## Usage
<img src='man/figures/morty.png' align="left" height="24" /></a> _"Aw geez, Rick, how do I use this package?"_
<img src='man/figures/rick.png' align="left" height="30" /></a> _"It's simple Morty, you idiot. First, take the dinglebop, and then smooth it out with a bunch of schleem. Then, push it through the grumbo, making sure to cut out the fleeb. Make sure the blamfs rub against the chumbles and that the ploobis and grumbo are shaved away. Then you will be left with a regular old plumbus."_
<img src='man/figures/morty.png' align="left" height="24" /></a> _"I-I-I don't know Rick, are you sure about that?"_
<img src='man/figures/rick.png' align="left" height="30" /></a> _"Yes of course I'm sure Morty. That's the difference between you and me: I'm certain, and you're a walking burlap sack filled with turds."_
<img src='man/figures/morty.png' align="left" height="24" /></a> _"So what you are saying is that R is such a great environment to wrangle data that the mortyr package abstracts away the API into just three functions: one that returns all characters, one that returns all locations, and one that returns all episodes, from each respective API endpoint?"_
<img src='man/figures/rick.png' align="left" height="30" /></a> _"Yes, obviously Morty. You're as dumb as they come. Why create overly-complicated R functions with a higher cognitive load when mortyr could do the hard work of returning and combining data from paginated API responses? It is not like we are dealing with big data here Morty. Now flip off all these R users that think this package is pointless Morty. I told them it means peace among worlds. How hilarious is that?"_
```{r}
library(mortyr)
get_characters()
get_locations()
get_episodes()
```
## Rate limit
The Rick and Morty API is an open API, no authentication is required for use. Nonetheless, to prevent malicious usage of the API there is a limit on the number of requests a given IP address can make. This limit is 10000 requests per day. If you happen to hit the limit you'll receive a 429 status (Too Many Requests) on all your requests during a period of 12 hours.
## Getting help
If you encounter a clear bug, please file a minimal reproducible example in [issues](https://github.com/MikeJohnPage/mortyr/issues).
<img src='man/figures/show-me-what-you-got.png' align="left" height="27" /></a> _"SHOW ME WHAT YOU GOT."_