Creates a dm object with the starwarsdb tables.
starwars_dm(configure_dm = TRUE, remote = FALSE)
starwars_dm_configure(dm)
If TRUE
(default) the returned dm object is
completely configured with all of the primary and foreign keys. Set to
FALSE
if you want to practice configuring the dm object yourself.
If TRUE
, uses the internal DuckDB database rather than local
tables, which is the default.
A dm object with the starwarsdb tables
A dm object
starwars_dm_configure
: Configure the starwars dm object with primary
and foreign keys and colors.
# If the {dm} package is installed...
if (requireNamespace("dm", quietly = TRUE)) {
# Create a full starwars {dm} object from local tables
starwars_dm(remote = TRUE)
# Create a base starwars {dm} object from remote tables wihout keys
starwars_dm(configure_dm = FALSE, remote = TRUE)
}
#> ── Table source ────────────────────────────────────────────────────────────────
#> src: DuckDB 0.6.0 [unknown@Linux 5.15.0-1024-azure:R 4.2.2/:memory:]
#> ── Metadata ────────────────────────────────────────────────────────────────────
#> Tables: `films`, `films_people`, `films_planets`, `films_vehicles`, `people`, … (9 total)
#> Columns: 58
#> Primary keys: 0
#> Foreign keys: 0