All Projects â†’ leonawicz â†’ Rtrek

leonawicz / Rtrek

Licence: other
R package for Star Trek datasets and related R functions.

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Rtrek

Dataspice
🌶 Create lightweight schema.org descriptions of your datasets
Stars: ✭ 137 (+251.28%)
Mutual labels:  data, r-package
Getlandsat
get landsat 8 images and metadata
Stars: ✭ 47 (+20.51%)
Mutual labels:  data, r-package
rsnps
Wrapper to a number of SNP web APIs
Stars: ✭ 44 (+12.82%)
Mutual labels:  data, r-package
Rgbif
Interface to the Global Biodiversity Information Facility API
Stars: ✭ 113 (+189.74%)
Mutual labels:  data, r-package
Charlatan
Create fake data in R
Stars: ✭ 209 (+435.9%)
Mutual labels:  data, r-package
Taxize
A taxonomic toolbelt for R
Stars: ✭ 209 (+435.9%)
Mutual labels:  data, r-package
kaggler
🏁 API client for Kaggle
Stars: ✭ 50 (+28.21%)
Mutual labels:  data, r-package
Graphql
Bindings to libgraphqlparser for R
Stars: ✭ 31 (-20.51%)
Mutual labels:  r-package
Cricketdata
International cricket data for men and women, Tests, ODIs and T20s
Stars: ✭ 35 (-10.26%)
Mutual labels:  r-package
Rdrpostagger
R package for Ripple Down Rules-based Part-Of-Speech Tagging (RDRPOS). On more than 45 languages.
Stars: ✭ 31 (-20.51%)
Mutual labels:  r-package
Universityrecruitment Ssurvey
用严肃的数据来回答“什么样的企业会到什么样的大学招聘”?
Stars: ✭ 30 (-23.08%)
Mutual labels:  data
Data Forge Ts
The JavaScript data transformation and analysis toolkit inspired by Pandas and LINQ.
Stars: ✭ 967 (+2379.49%)
Mutual labels:  data
Auto Value Bundle
Extends Autovalue to extract data from a bundle into a value object.
Stars: ✭ 36 (-7.69%)
Mutual labels:  data
Plnmodels
A collection of Poisson lognormal models for multivariate count data analysis
Stars: ✭ 31 (-20.51%)
Mutual labels:  r-package
Tools
My MATLAB tools + other stuff
Stars: ✭ 37 (-5.13%)
Mutual labels:  data
Sofa
easy R interface to CouchDB
Stars: ✭ 30 (-23.08%)
Mutual labels:  r-package
Unicode Tr51
Emoji data extracted from Unicode Technical Report #51.
Stars: ✭ 38 (-2.56%)
Mutual labels:  data
Webmockr
R library for stubbing and setting expectations on HTTP requests
Stars: ✭ 37 (-5.13%)
Mutual labels:  r-package
Apogee
Tools for dealing with APOGEE data
Stars: ✭ 34 (-12.82%)
Mutual labels:  data
Spades
R package for developing and running Spatial Discrete Event Simulation models
Stars: ✭ 34 (-12.82%)
Mutual labels:  r-package

rtrek

Author: Matthew Leonawicz
License: MIT

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Travis-CI Build Status AppVeyor Build Status Coverage Status

CRAN status CRAN downloads Github Stars

The rtrek package provides datasets related to the Star Trek fictional universe and functions for working with those datasets. It interfaces with the Star Trek API (STAPI), Memory Alpha and Memory Beta to retrieve data, metadata and other information relating to Star Trek.

The package also contains several local datasets covering a variety of topics such as Star Trek timeline data, universe species data and geopolitical data. Some of these are more information rich, while others are toy examples useful for simple demonstrations. The bulk of Star Trek data is accessed from external sources by API. A future version of rtrek will also include summary datasets resulting from text mining analyses of Star Trek novels.

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


Installation

Install the CRAN release of rtrek with

install.packages("rtrek")

Install the development version from GitHub with

# install.packages("remotes")
remotes::install_github("leonawicz/rtrek")

Examples

Time to be good detectives. Good thing Data has R installed.

These are just a few examples to help you jump right in. See the package articles for more.

STAPI

Use the Star Trek API (STAPI) to obtain information on 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: 66

stapi("character", page = 1) %>% select(uid, name)
#> # A tibble: 100 x 2
#>    uid            name            
#>    <chr>          <chr>           
#>  1 CHMA0000021696 Pechetti        
#>  2 CHMA0000028502 Pomet           
#>  3 CHMA0000134966 Eddie Newsom    
#>  4 CHMA0000101321 T. Virts        
#>  5 CHMA0000053158 Annabelle series
#>  6 CHMA0000008975 Torias Dax      
#>  7 CHMA0000232471 T. Peel         
#>  8 CHMA0000087568 Grathon Tolar   
#>  9 CHMA0000190805 C. Russell      
#> 10 CHMA0000069617 Mike Vejar      
#> # ... with 90 more rows

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 EPMA0000000845                Q-Less      46531.2    46531.2
#> 3 EPMA0000001329                 Q Who      42761.3    42761.3
#> 4 EPMA0000000651              Tapestry           NA         NA
#> 5 EPMA0000001510    The Q and the Grey      50384.2    50392.7
#> 6 EPMA0000000483 Encounter at Farpoint      41153.7    41153.7
#> 7 EPMA0000162588            Death Wish           NA         NA
#> 8 EPMA0000001413                True Q      46192.3    46192.3
#> 9 EPMA0000001377                  Qpid      44741.9    44741.9

Memory Alpha

Obtain content and metadata from the article about Spock on Memory Alpha:

x <- ma_article("Spock")
x
#> # A tibble: 1 x 4
#>   title content    metadata          categories       
#>   <chr> <list>     <list>            <list>           
#> 1 Spock <xml_ndst> <tibble [1 x 19]> <tibble [15 x 2]>
x$metadata[[1]]$Born
#> [1] "January 6, 2230 (stardate 2230.06)|ShiKahr, Vulcan"

Memory Beta

Spock was born in 2230. Obtain a subset of the Star Trek universe historical timeline for that year:

mb_timeline(2230)
#> 2230
#> $events
#> # A tibble: 5 x 4
#>   period id                date  notes                                                              
#>   <chr>  <chr>             <chr> <chr>                                                              
#> 1 2230   Events            <NA>  Argelius II  and Betelgeuse become members of the Federation.[1][2]
#> 2 2230   Births_and_Deaths <NA>  Spock is born deep within a cave in Vulcan's Forge on Vulcan.[3][4]
#> 3 2230   Births_and_Deaths <NA>  George Samuel Kirk, Jr. is born.[5]                                
#> 4 2230   Births_and_Deaths <NA>  David Rabin is born.[6]                                            
#> 5 2230   Births_and_Deaths <NA>  Roy John Moss is born.[7]                                          
#> 
#> $stories
#> # A tibble: 5 x 11
#>   title           title_url          colleciton   collection_url  section       context series     date      media     notes                                   image_url       
#>   <chr>           <chr>              <chr>        <chr>           <chr>         <chr>   <chr>      <chr>     <chr>     <chr>                                   <chr>           
#> 1 Burning Dreams  Burning_Dreams     <NA>         <NA>            Chapters 4 &~ <NA>    The Origi~ 2230      novel     <NA>                                    File:BurningDre~
#> 2 Star Trek V: T~ Star_Trek_V:_The_~ <NA>         <NA>            Chapter 14    <NA>    The Origi~ 2230      movie no~ <NA>                                    File:TrekV.jpg  
#> 3 IDW Star Trek,~ IDW_Star_Trek,_Is~ Star Trek (~ Star_Trek_(IDW) 2230 flashba~ <NA>    The Origi~ 2230      comic     Flashback to USS Kelvin and Keenser's ~ File:IDW_TOS_14~
#> 4 Star Trek       Star_Trek_(2009)   <NA>         <NA>            Chapter 1 (s~ <NA>    The Origi~ 2230      movie no~ Depiction of Spock's birth, date taken~ File:Star_Trek_~
#> 5 Sarek           Sarek_(novel)      <NA>         <NA>            Chapter 5     <NA>    The Origi~ 12 Novem~ novel     <NA>                                    File:Sarek_nove~

Live long and prosper.

Reference

Complete package reference and function documentation

Packages in the trekverse

rtrek: The core Star Trek package

Datasets related to Star Trek, API wrappers to external data sources, and more.


lcars: LCARS aesthetic for Shiny

Create Shiny apps based on the Library Computer Access/Retrieval System (LCARS).


trekcolors: A color palette package

Predefined and customizable Star Trek themed color palettes and related functions.


trekfont: A fonts package

True (Trek) type fonts to style your Star Trek themed graphics text.


Citation

Matthew Leonawicz (2020). rtrek: Datasets and Functions Relating to Star Trek. R package version 0.3.2. https://CRAN.R-project.org/package=rtrek

Contribute

Contributions are welcome. Contribute through GitHub via pull request. Please create an issue first if it is regarding any substantive feature add or change.

If you enjoy my open source R community contributions, please consider a donation :).


Please note that the rtrek project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].