Skip to content
mortyr: R wrapper to The Rick and Morty API
R
Branch: master
Clone or download
Latest commit 6a72260 Jul 19, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R Update CRAN requests Jul 18, 2019
man Update CRAN requests Jul 18, 2019
tests Add funcs and tests Jul 8, 2019
.Rbuildignore Update Jul 9, 2019
.Rhistory Update Jul 19, 2019
.gitignore Update gitignore Jul 9, 2019
.travis.yml Update Jul 9, 2019
CRAN-RELEASE Update Jul 19, 2019
DESCRIPTION Update Jul 19, 2019
LICENSE Update Jul 9, 2019
LICENSE.md Update Jul 9, 2019
NAMESPACE Update Jul 9, 2019
README.Rmd Update Jul 19, 2019
README.md Update Jul 19, 2019
cran-comments.md Update Jul 19, 2019
mortyr.Rproj Add package structure Jul 5, 2019

README.md

mortyr

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

Overview

mortyr is an R wrapper to the The Rick and Morty API 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:

install.packages("mortyr")

Or install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("MikeJohnPage/mortyr")

Usage

“Aw geez, Rick, how do I use this package?”

“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.”

“I-I-I don’t know Rick, are you sure about that?”

“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.”

“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?”

“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?”

library(mortyr)

get_characters()
#> # A tibble: 493 x 14
#>      id name  status species type  gender image episode url   created
#>   <int> <chr> <chr>  <chr>   <chr> <chr>  <chr> <list>  <chr> <chr>  
#> 1     1 Rick… Alive  Human   ""    Male   http… <chr [… http… 2017-1…
#> 2     2 Mort… Alive  Human   ""    Male   http… <chr [… http… 2017-1…
#> 3     3 Summ… Alive  Human   ""    Female http… <chr [… http… 2017-1…
#> 4     4 Beth… Alive  Human   ""    Female http… <chr [… http… 2017-1…
#> 5     5 Jerr… Alive  Human   ""    Male   http… <chr [… http… 2017-1…
#> # … with 488 more rows, and 4 more variables

get_locations()
#> # A tibble: 76 x 7
#>      id name      type     dimension  residents url             created    
#>   <int> <chr>     <chr>    <chr>      <list>    <chr>           <chr>      
#> 1     1 Earth (C… Planet   Dimension… <chr [27… https://rickan… 2017-11-10…
#> 2     2 Abadango  Cluster  unknown    <chr [1]> https://rickan… 2017-11-10…
#> 3     3 Citadel … Space s… unknown    <chr [91… https://rickan… 2017-11-10…
#> 4     4 Worldend… Planet   unknown    <chr [9]> https://rickan… 2017-11-10…
#> 5     5 Anatomy … Microve… Dimension… <chr [11… https://rickan… 2017-11-10…
#> # … with 71 more rows

get_episodes()
#> # A tibble: 31 x 7
#>      id name       air_date   episode characters url            created    
#>   <int> <chr>      <chr>      <chr>   <list>     <chr>          <chr>      
#> 1     1 Pilot      December … S01E01  <chr [19]> https://ricka… 2017-11-10…
#> 2     2 Lawnmower… December … S01E02  <chr [19]> https://ricka… 2017-11-10…
#> 3     3 Anatomy P… December … S01E03  <chr [24]> https://ricka… 2017-11-10…
#> 4     4 M. Night … January 1… S01E04  <chr [13]> https://ricka… 2017-11-10…
#> 5     5 Meeseeks … January 2… S01E05  <chr [20]> https://ricka… 2017-11-10…
#> # … with 26 more rows

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.

“SHOW ME WHAT YOU GOT.”

You can’t perform that action at this time.