glimpse()
provides an overview (dimensions, column data types, primary
keys, etc.) of all tables included in the dm
object. It will additionally
print details about outgoing foreign keys for the child table.
glimpse()
is provided by the pillar package, and re-exported by dm.
See pillar::glimpse()
for more details.
Arguments
- x
A
dm
object.- width
Controls the maximum number of columns on a line used in printing. If
NULL
,getOption("width")
will be consulted.- ...
Passed to
pillar::glimpse()
.
Examples
dm_nycflights13() %>% glimpse()
#> dm of 5 tables: `airlines`, `airports`, `flights`, `planes`, `weather`
#>
#> ────────────────────────────────────────────────────────────────────────────────
#>
#> Table: `airlines`
#> Primary key: `carrier`
#>
#> Rows: 15
#> Columns: 2
#> $ carrier <chr> "9E", "AA", "AS", "B6", "DL", "EV", "F9", "FL", "HA", "MQ", "U…
#> $ name <chr> "Endeavor Air Inc.", "American Airlines Inc.", "Alaska Airline…
#>
#> ────────────────────────────────────────────────────────────────────────────────
#>
#> Table: `airports`
#> Primary key: `faa`
#>
#> Rows: 86
#> Columns: 8
#> $ faa <chr> "ALB", "ATL", "AUS", "BDL", "BHM", "BNA", "BOS", "BTV", "BUF", "…
#> $ name <chr> "Albany Intl", "Hartsfield Jackson Atlanta Intl", "Austin Bergst…
#> $ lat <dbl> 42.74827, 33.63672, 30.19453, 41.93889, 33.56294, 36.12447, 42.3…
#> $ lon <dbl> -73.80169, -84.42807, -97.66989, -72.68322, -86.75355, -86.67819…
#> $ alt <dbl> 285, 1026, 542, 173, 644, 599, 19, 335, 724, 778, 146, 236, 1228…
#> $ tz <dbl> -5, -5, -6, -5, -6, -6, -5, -5, -5, -8, -5, -5, -5, -5, -5, -5, …
#> $ dst <chr> "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A",…
#> $ tzone <chr> "America/New_York", "America/New_York", "America/Chicago", "Amer…
#>
#> ────────────────────────────────────────────────────────────────────────────────
#>
#> Table: `flights`
#> 4 outgoing foreign key(s):
#> `carrier` -> `airlines$carrier` no_action
#> `origin` -> `airports$faa` no_action
#> `tailnum` -> `planes$tailnum` no_action
#> (`origin`, `time_hour`) -> (`weather$origin`, `weather$time_hour`) no_action
#>
#> Rows: 1,761
#> Columns: 19
#> $ year <int> 2013, 2013, 2013, 2013, 2013, 2013, 2013, 2013, 2013, 2…
#> $ month <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
#> $ day <int> 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,…
#> $ dep_time <int> 3, 16, 450, 520, 530, 531, 535, 546, 549, 550, 553, 553…
#> $ sched_dep_time <int> 2359, 2359, 500, 525, 530, 540, 540, 600, 600, 600, 600…
#> $ dep_delay <dbl> 4, 17, -10, -5, 0, -9, -5, -14, -11, -10, -7, -7, -7, -…
#> $ arr_time <int> 426, 447, 634, 813, 824, 832, 1015, 645, 652, 649, 711,…
#> $ sched_arr_time <int> 437, 444, 648, 820, 829, 850, 1017, 709, 724, 703, 715,…
#> $ arr_delay <dbl> -11, 3, -14, -7, -5, -18, -2, -24, -32, -14, -4, -33, -…
#> $ carrier <chr> "B6", "B6", "US", "UA", "UA", "AA", "B6", "B6", "EV", "…
#> $ flight <int> 727, 739, 1117, 1018, 404, 1141, 725, 380, 6055, 2114, …
#> $ tailnum <chr> "N571JB", "N564JB", "N171US", "N35204", "N815UA", "N5EA…
#> $ origin <chr> "JFK", "JFK", "EWR", "EWR", "LGA", "JFK", "JFK", "EWR",…
#> $ dest <chr> "BQN", "PSE", "CLT", "IAH", "IAH", "MIA", "BQN", "BOS",…
#> $ air_time <dbl> 183, 191, 78, 215, 210, 149, 191, 39, 48, 36, 51, 201, …
#> $ distance <dbl> 1576, 1617, 529, 1400, 1416, 1089, 1576, 200, 229, 184,…
#> $ hour <dbl> 23, 23, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,…
#> $ minute <dbl> 59, 59, 0, 25, 30, 40, 40, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0…
#> $ time_hour <dttm> 2013-01-10 23:00:00, 2013-01-10 23:00:00, 2013-01-10 0…
#>
#> ────────────────────────────────────────────────────────────────────────────────
#>
#> Table: `planes`
#> Primary key: `tailnum`
#>
#> Rows: 945
#> Columns: 9
#> $ tailnum <chr> "N10156", "N104UW", "N10575", "N105UW", "N110UW", "N11106…
#> $ year <int> 2004, 1999, 2002, 1999, 1999, 2002, 2002, 2002, 2003, 200…
#> $ type <chr> "Fixed wing multi engine", "Fixed wing multi engine", "Fi…
#> $ manufacturer <chr> "EMBRAER", "AIRBUS INDUSTRIE", "EMBRAER", "AIRBUS INDUSTR…
#> $ model <chr> "EMB-145XR", "A320-214", "EMB-145LR", "A320-214", "A320-2…
#> $ engines <int> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, …
#> $ seats <int> 55, 182, 55, 182, 182, 55, 55, 55, 55, 55, 55, 55, 55, 55…
#> $ speed <int> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…
#> $ engine <chr> "Turbo-fan", "Turbo-fan", "Turbo-fan", "Turbo-fan", "Turb…
#>
#> ────────────────────────────────────────────────────────────────────────────────
#>
#> Table: `weather`
#> Primary key: (`origin`, `time_hour`)
#>
#> Rows: 144
#> Columns: 15
#> $ origin <chr> "EWR", "EWR", "EWR", "EWR", "EWR", "EWR", "EWR", "EWR", "EW…
#> $ year <int> 2013, 2013, 2013, 2013, 2013, 2013, 2013, 2013, 2013, 2013,…
#> $ month <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
#> $ day <int> 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,…
#> $ hour <int> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1…
#> $ temp <dbl> 41.00, 39.02, 39.02, 39.92, 41.00, 41.00, 39.92, 41.00, 42.…
#> $ dewp <dbl> 32.00, 30.02, 28.94, 26.96, 26.06, 26.06, 24.98, 24.98, 24.…
#> $ humid <dbl> 70.08, 69.86, 66.85, 59.50, 54.97, 54.97, 54.81, 52.56, 48.…
#> $ wind_dir <dbl> 230, 210, 230, 270, 320, 300, 280, 330, 330, 320, 320, 330,…
#> $ wind_speed <dbl> 8.05546, 9.20624, 6.90468, 5.75390, 6.90468, 12.65858, 6.90…
#> $ wind_gust <dbl> NA, NA, NA, NA, NA, 20.71404, 17.26170, NA, NA, 26.46794, N…
#> $ precip <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
#> $ pressure <dbl> 1024.6, 1025.9, 1026.9, 1027.5, 1028.2, 1029.0, 1030.0, 103…
#> $ visib <dbl> 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,…
#> $ time_hour <dttm> 2013-01-10 00:00:00, 2013-01-10 01:00:00, 2013-01-10 02:00…
#>
#> ────────────────────────────────────────────────────────────────────────────────
dm_nycflights13() %>%
dm_zoom_to(flights) %>%
glimpse()
#> dm of 5 tables: `airlines`, `airports`, `flights`, `planes`, `weather`
#>
#> Zoomed table: `flights`
#> 4 outgoing foreign key(s):
#> `carrier` -> `airlines$carrier` no_action
#> `origin` -> `airports$faa` no_action
#> `tailnum` -> `planes$tailnum` no_action
#> (`origin`, `time_hour`) -> (`weather$origin`, `weather$time_hour`) no_action
#>
#> Rows: 1,761
#> Columns: 19
#> $ year <int> 2013, 2013, 2013, 2013, 2013, 2013, 2013, 2013, 2013, 2…
#> $ month <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
#> $ day <int> 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,…
#> $ dep_time <int> 3, 16, 450, 520, 530, 531, 535, 546, 549, 550, 553, 553…
#> $ sched_dep_time <int> 2359, 2359, 500, 525, 530, 540, 540, 600, 600, 600, 600…
#> $ dep_delay <dbl> 4, 17, -10, -5, 0, -9, -5, -14, -11, -10, -7, -7, -7, -…
#> $ arr_time <int> 426, 447, 634, 813, 824, 832, 1015, 645, 652, 649, 711,…
#> $ sched_arr_time <int> 437, 444, 648, 820, 829, 850, 1017, 709, 724, 703, 715,…
#> $ arr_delay <dbl> -11, 3, -14, -7, -5, -18, -2, -24, -32, -14, -4, -33, -…
#> $ carrier <chr> "B6", "B6", "US", "UA", "UA", "AA", "B6", "B6", "EV", "…
#> $ flight <int> 727, 739, 1117, 1018, 404, 1141, 725, 380, 6055, 2114, …
#> $ tailnum <chr> "N571JB", "N564JB", "N171US", "N35204", "N815UA", "N5EA…
#> $ origin <chr> "JFK", "JFK", "EWR", "EWR", "LGA", "JFK", "JFK", "EWR",…
#> $ dest <chr> "BQN", "PSE", "CLT", "IAH", "IAH", "MIA", "BQN", "BOS",…
#> $ air_time <dbl> 183, 191, 78, 215, 210, 149, 191, 39, 48, 36, 51, 201, …
#> $ distance <dbl> 1576, 1617, 529, 1400, 1416, 1089, 1576, 200, 229, 184,…
#> $ hour <dbl> 23, 23, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,…
#> $ minute <dbl> 59, 59, 0, 25, 30, 40, 40, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0…
#> $ time_hour <dttm> 2013-01-10 23:00:00, 2013-01-10 23:00:00, 2013-01-10 0…