Datasets and Functions Relating to Star Trek

Provides datasets related to the Star Trek fictional universe and functions for working with the data. The package also provides access to real world datasets based on the televised series and other related licensed media productions. It interfaces with the Star Trek API (STAPI) (< http://stapi.co/>), Memory Alpha (< http://memory-alpha.wikia.com/>), and Memory Beta (< http://memory-beta.wikia.com/>) to retrieve data, metadata and other information relating to Star Trek. It also contains several local datasets covering a variety of topics. The package also provides functions for working with data from other Star Trek-related R data packages containing larger datasets not stored in 'rtrek'.


rtrek

CRAN status CRAN downloads Rdoc Travis-CI Build Status AppVeyor Build Status Coverage Status gitter

The rtrek package provides datasets related to the Star Trek fictional universe and functions to assist with the data. It interfaces with Wikipedia, STAPI, Memory Alpha and Memory Beta to retrieve data, metadata and other information relating to Star Trek. It also contains local sample datasets covering a variety of topics such as Star Trek universe species data, geopolitical data, and summary datasets resulting from text mining analyses of Star Trek novels. The package also provides functions for working with data from other Star Trek-related R data packages containing larger datasets not stored in rtrek.

Note: This package is in beta (and not just the quadrant). Breaking changes may occur.

Image: Example Leaflet map using non-geographic Star Trek map tiles.



Installation

Install the development version of rtrek from GitHub with:

devtools::install_github("leonawicz/rtrek")

Example


Use the Star Trek API (STAPI) to obtain information on the whereabouts and whenabouts of the infamous character, Q. Specifically, retrieve data on his appearances and the stardates when he shows up. The first API call does a lightweight, unobtrusive check to see how many pages of potential search results exist for characters in the database. There are a lot of characters. The second call grabs only page two results. The third call uses the universal/unique ID uid to retrieve data on Q. Think of these three successive uses of stapi as safe mode, search mode and extraction mode.

library(rtrek)
library(dplyr)
stapi("character", page_count = TRUE)
#> Total pages to retrieve all results: 62
 
stapi("character", page = 2)
#> # A tibble: 100 x 24
#>    uid     name    gender yearOfBirth monthOfBirth dayOfBirth placeOfBirth
#>    <chr>   <chr>   <chr>        <int>        <int>      <int> <lgl>       
#>  1 CHMA00~ Fuller  M               NA           NA         NA NA          
#>  2 CHMA00~ Burkus  M               NA           NA         NA NA          
#>  3 CHMA00~ Masaka~ <NA>            NA           NA         NA NA          
#>  4 CHMA00~ Thorne  M               NA           NA         NA NA          
#>  5 CHMA00~ Ah-Kel  M               NA           NA         NA NA          
#>  6 CHMA00~ Robert~ <NA>            NA           NA         NA NA          
#>  7 CHMA00~ Q       M               NA           NA         NA NA          
#>  8 CHMA00~ John D~ <NA>            NA           NA         NA NA          
#>  9 CHMA00~ Louis ~ <NA>            NA           NA         NA NA          
#> 10 CHMA00~ Marat ~ M               NA           NA         NA NA          
#> # ... with 90 more rows, and 17 more variables: yearOfDeath <int>,
#> #   monthOfDeath <lgl>, dayOfDeath <lgl>, placeOfDeath <lgl>,
#> #   height <int>, weight <int>, deceased <lgl>, bloodType <chr>,
#> #   maritalStatus <chr>, serialNumber <chr>, hologramActivationDate <chr>,
#> #   hologramStatus <chr>, hologramDateStatus <lgl>, hologram <lgl>,
#> #   fictionalCharacter <lgl>, mirror <lgl>, alternateReality <lgl>
 
Q <- "CHMA0000025118"  #unique ID
Q <- stapi("character", uid = Q)
Q$episodes %>% select(uid, title, stardateFrom, stardateTo)
#>              uid                 title stardateFrom stardateTo
#> 1 EPMA0000001458    All Good Things...      47988.0    47988.0
#> 2 EPMA0000001329                 Q Who      42761.3    42761.3
#> 3 EPMA0000000483 Encounter at Farpoint      41153.7    41153.7
#> 4 EPMA0000162588            Death Wish           NA         NA
#> 5 EPMA0000001510    The Q and the Grey      50384.2    50392.7
#> 6 EPMA0000000845                Q-Less      46531.2    46531.2
#> 7 EPMA0000000651              Tapestry           NA         NA
#> 8 EPMA0000001413                True Q      46192.3    46192.3
#> 9 EPMA0000001377                  Qpid      44741.9    44741.9

Live long and prosper.

See the introduction vignette for more details and examples.

Reference

Complete package reference and function documentation

News

rtrek 0.1.0

  • Refactored some functions and datasets.
  • Added new stBooks dataset, renamed previous stBooks to stBooksWP.
  • Added connection to new map tile set, galaxy2.
  • Add two more species/homeworlds to example data.
  • Updated documentation.
  • Added and updated unit tests.

rtrek 0.0.9

  • Remove remote trekfont now that it is available on CRAN.
  • Prepare GitHub accessible external datasets that serve package web pages.
  • Updated documentation, webste. Add to "fun pages" (R & R), which are only part of website "vignettes", not package vignettes.
  • Minor fixes.

rtrek 0.0.8

  • Added more robust testing of API entity searches.
  • Minor refactor of stapi internals and addition of stapiEntities dataset.
  • Added optional (non-dependent) association with trekfont package with a function st_font to list and preview fonts from that package.
  • Updated documentation.
  • Minor fixes.

rtrek 0.0.7

  • Added additional vignettes.
  • Optional integration with trekfont package.
  • Improved website, including initial version of Stellar Cartography page.
  • Update data.
  • Minor fixes.
  • Updated readme and docs.

rtrek 0.0.6

  • Added initial introduction vignette content.
  • Added anti-DDOS measures for API calls.
  • Minor fixes.
  • Updated unit tests.
  • Updated readme.

rtrek 0.0.5

  • Added initial Star Trek data API functionality via STAPI wrapper.
  • Updated documentation.
  • Added unit tests.
  • Added moderately curated data frame of Star Trek novels metadata scraped from Wikipedia.
  • Added convenience function for accessing specific Wikipedia entries in browser.

rtrek 0.0.1

  • Added minimal data and functions.
  • Added basic unit tests.
  • Updated documentation, improved dataset and object curation.

rtrek 0.0.0.9000

  • Added initial package scaffolding.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("rtrek")

0.2.0 by Matthew Leonawicz, a month ago


https://github.com/leonawicz/rtrek


Report a bug at https://github.com/leonawicz/rtrek/issues


Browse source code at https://github.com/cran/rtrek


Authors: Matthew Leonawicz [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports magrittr, dplyr, jsonlite, xml2, rvest, jpeg, purrr, ggplot2, memoise, tibble, tidyr, downloader

Suggests testthat, knitr, rmarkdown, covr, leaflet, lintr, showtext, sysfonts, trekfont


See at CRAN