All Projects → gadenbuie → starwarsdb

gadenbuie / starwarsdb

Licence: other
Relational Data from the Star Wars API for Learning and Teaching

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to starwarsdb

Zimjs
ZIM JavaScript Canvas Framework - Code Creativity! Interactive Media For All.
Stars: ✭ 259 (+661.76%)
Mutual labels:  learning, teaching
Robotopia
🤖 Introducing kids to coding with tiny virtual robots!
Stars: ✭ 478 (+1305.88%)
Mutual labels:  learning, teaching
Oh My Git
An interactive Git learning game!
Stars: ✭ 250 (+635.29%)
Mutual labels:  learning, teaching
xplain
A framework for providing interactive interpretations and explanations of statistical results
Stars: ✭ 26 (-23.53%)
Mutual labels:  learning, teaching
Cli Boot.camp
💻 command-line bootcamp adventure in your browser
Stars: ✭ 88 (+158.82%)
Mutual labels:  learning, teaching
Oppia
A free, online learning platform to make quality education accessible for all.
Stars: ✭ 4,361 (+12726.47%)
Mutual labels:  learning, teaching
Jupyter Edu Book
Teaching and Learning with Jupyter
Stars: ✭ 325 (+855.88%)
Mutual labels:  learning, teaching
Teaching App Dev Swift
DEPRECATED. Instructor lesson plans that accompany Xcode projects, for guiding in-class experiential learning.
Stars: ✭ 699 (+1955.88%)
Mutual labels:  learning, teaching
Estrutura De Dados Em Java
Repositório do Material Estrutura de Dados em Java, contendo os principais tópicos de disciplinas sobre Estrutura de Dados. CURSO SOBRE ED: https://luisaraujo.github.io/Estrutura-de-Dados-em-Java/index.html
Stars: ✭ 58 (+70.59%)
Mutual labels:  learning, teaching
Blockchain Learning
Learn and promote blockchain together by writing
Stars: ✭ 44 (+29.41%)
Mutual labels:  learning, teaching
Yrssf
一个分布式(p2p)云教学/云课堂/直播平台系统CMS,睿易派的开源替代品
Stars: ✭ 141 (+314.71%)
Mutual labels:  learning, teaching
Learnquery
Learn JavaScript fundamentals by building your own jQuery equivalent library
Stars: ✭ 136 (+300%)
Mutual labels:  learning, teaching
Py Rse
Research Software Engineering with Python course material
Stars: ✭ 145 (+326.47%)
Mutual labels:  learning, teaching
nosso-py
Um repositório com materiais e muito mais para aprender, programar e se divertir com Python!
Stars: ✭ 51 (+50%)
Mutual labels:  learning
learn-react-typescript
Learning React contents with TypeScript (Hooks, Redux)
Stars: ✭ 15 (-55.88%)
Mutual labels:  learning
named-entity-recognition
Notebooks for teaching Named Entity Recognition at the Cultural Heritage Data School, run by Cambridge Digital Humanities
Stars: ✭ 18 (-47.06%)
Mutual labels:  teaching
antares
Digital circuit learning platform
Stars: ✭ 15 (-55.88%)
Mutual labels:  learning
kaneton
kaneton is an educational microkernel that has been used for teaching purposes for over 8 years.
Stars: ✭ 29 (-14.71%)
Mutual labels:  teaching
frontendQuickbytes
A repo containing real life frontend challenges which you can use to practice frontend!
Stars: ✭ 129 (+279.41%)
Mutual labels:  learning
multi-contact-grasping
This project implements a simulated grasp-and-lift process in V-REP using the Barrett Hand, with an interface through a python remote API.
Stars: ✭ 52 (+52.94%)
Mutual labels:  learning

starwarsdb

CRAN status tic status

starwarsdb provides data from the Star Wars API as a set of relational tables, or as an in-package DuckDB database.

Formats: Metadata, Local Tables, Remote Tables, Data Model (dm), API (rwars)

Installation

You can install starwarsdb from CRAN:

install.packages("starwarsdb")

Or you can install the development version of starwarsdb from GitHub with remotes:

# install.packages("remotes")

remotes::install_github("gadenbuie/starwarsdb")

# For remotes <= 2.1.0
remotes::install_github("gadenbuie/starwarsdb@main")

Star Wars Data

All of the tables are available when you load starwarsdb

library(dplyr)
library(starwarsdb)

or via

data(package = "starwarsdb")

The schema table includes information about the tables that were sourced from SWAPI.

schema
#> # A tibble: 5 x 4
#>   endpoint endpoint_title endpoint_description                  properties      
#>   <chr>    <chr>          <chr>                                 <list>          
#> 1 films    Film           A Star Wars film                      <tibble [14 × 4…
#> 2 vehicles Starship       A Starship or vehicle                 <tibble [19 × 4…
#> 3 species  People         A species within the Star Wars unive… <tibble [15 × 4…
#> 4 planets  Planet         A planet.                             <tibble [14 × 4…
#> 5 people   People         A person within the Star Wars univer… <tibble [16 × 4…
schema %>% 
  filter(endpoint == "films") %>% 
  pull(properties)
#> [[1]]
#> # A tibble: 14 x 4
#>    variable     type    description                                      format 
#>    <chr>        <chr>   <chr>                                            <chr>  
#>  1 starships    array   The starship resources featured within this fil… <NA>   
#>  2 edited       string  the ISO 8601 date format of the time that this … date-t…
#>  3 planets      array   The planet resources featured within this film.  <NA>   
#>  4 producer     string  The producer(s) of this film.                    <NA>   
#>  5 title        string  The title of this film.                          <NA>   
#>  6 url          string  The url of this resource                         uri    
#>  7 release_date string  The release date at original creator country.    date   
#>  8 vehicles     array   The vehicle resources featured within this film. <NA>   
#>  9 episode_id   integer The episode number of this film.                 <NA>   
#> 10 director     string  The director of this film.                       <NA>   
#> 11 created      string  The ISO 8601 date format of the time that this … date-t…
#> 12 opening_cra… string  The opening crawl text at the beginning of this… <NA>   
#> 13 characters   array   The people resources featured within this film.  <NA>   
#> 14 species      array   The species resources featured within this film. <NA>

Local Tables

Ask questions, like who flew an X-Wing?

x_wing_pilots <- pilots %>% filter(vehicle == "X-wing")
x_wing_pilots
#> # A tibble: 4 x 2
#>   pilot             vehicle
#>   <chr>             <chr>  
#> 1 Luke Skywalker    X-wing 
#> 2 Biggs Darklighter X-wing 
#> 3 Wedge Antilles    X-wing 
#> 4 Jek Tono Porkins  X-wing

people %>% semi_join(x_wing_pilots, by = c(name = "pilot"))
#> # A tibble: 4 x 11
#>   name  height  mass hair_color skin_color eye_color birth_year gender homeworld
#>   <chr>  <dbl> <dbl> <chr>      <chr>      <chr>          <dbl> <chr>  <chr>    
#> 1 Luke…    172    77 blond      fair       blue              19 mascu… Tatooine 
#> 2 Bigg…    183    84 black      light      brown             24 mascu… Tatooine 
#> 3 Wedg…    170    77 brown      fair       hazel             21 mascu… Corellia 
#> 4 Jek …    180   110 brown      fair       blue              NA mascu… Bestine …
#> # … with 2 more variables: species <chr>, sex <chr>

Remote Tables

starwarsdb also includes the entire data set as a DuckDB database, appropriate for teaching and practicing remote database access with dbplyr.

con <- starwars_connect()

people_rmt <- tbl(con, "people")
pilots_rmt <- tbl(con, "pilots")
pilots_rmt
#> # Source:   table<pilots> [?? x 2]
#> # Database: duckdb_connection
#>    pilot             vehicle          
#>    <chr>             <chr>            
#>  1 Chewbacca         Millennium Falcon
#>  2 Han Solo          Millennium Falcon
#>  3 Lando Calrissian  Millennium Falcon
#>  4 Nien Nunb         Millennium Falcon
#>  5 Luke Skywalker    X-wing           
#>  6 Biggs Darklighter X-wing           
#>  7 Wedge Antilles    X-wing           
#>  8 Jek Tono Porkins  X-wing           
#>  9 Darth Vader       TIE Advanced x1  
#> 10 Boba Fett         Slave 1          
#> # … with more rows

x_wing_pilots <- pilots_rmt %>% filter(vehicle == "X-wing")
x_wing_pilots
#> # Source:   lazy query [?? x 2]
#> # Database: duckdb_connection
#>   pilot             vehicle
#>   <chr>             <chr>  
#> 1 Luke Skywalker    X-wing 
#> 2 Biggs Darklighter X-wing 
#> 3 Wedge Antilles    X-wing 
#> 4 Jek Tono Porkins  X-wing

people_rmt %>% semi_join(x_wing_pilots, by = c(name = "pilot"))
#> # Source:   lazy query [?? x 11]
#> # Database: duckdb_connection
#>   name  height  mass hair_color skin_color eye_color birth_year gender homeworld
#>   <chr>  <dbl> <dbl> <chr>      <chr>      <chr>          <dbl> <chr>  <chr>    
#> 1 Luke…    172    77 blond      fair       blue              19 mascu… Tatooine 
#> 2 Bigg…    183    84 black      light      brown             24 mascu… Tatooine 
#> 3 Wedg…    170    77 brown      fair       hazel             21 mascu… Corellia 
#> 4 Jek …    180   110 brown      fair       blue              NA mascu… Bestine …
#> # … with 2 more variables: species <chr>, sex <chr>

DM Tables

Finally, starwarsdb provides a function that returns a pre-configured dm object. The dm package wraps local data frames into a complete relational data model.

library(dm, warn.conflicts = FALSE)

sw_dm <- starwars_dm()
sw_dm
#> ── Metadata ────────────────────────────────────────────────────────────────────
#> Tables: `films`, `people`, `planets`, `species`, `vehicles`, … (9 total)
#> Columns: 58
#> Primary keys: 5
#> Foreign keys: 10

sw_dm %>%
  dm_select_tbl(pilots, people) %>%
  dm_filter("pilots", vehicle == "X-wing") %>%
  dm_apply_filters() %>%
  dm_zoom_to("people") %>%
  semi_join(pilots)
#> # Zoomed table: people
#> # A tibble:     4 x 11
#>   name  height  mass hair_color skin_color eye_color birth_year gender homeworld
#>   <chr>  <dbl> <dbl> <chr>      <chr>      <chr>          <dbl> <chr>  <chr>    
#> 1 Luke…    172    77 blond      fair       blue              19 mascu… Tatooine 
#> 2 Bigg…    183    84 black      light      brown             24 mascu… Tatooine 
#> 3 Wedg…    170    77 brown      fair       hazel             21 mascu… Corellia 
#> 4 Jek …    180   110 brown      fair       blue              NA mascu… Bestine …
#> # … with 2 more variables: species <chr>, sex <chr>
dm_draw(sw_dm)

API

For API access from R, check out the rwars package by Oliver Keyes. Big thanks to rwars for making it easy to access the Star Wars API!

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].