This function has methods for both dm
classes:
With pull_tbl.dm()
you can chose which table of the dm
you want to retrieve.
With pull_tbl.zoomed_dm()
you will retrieve the zoomed table in the current state.
pull_tbl(dm, table)
dm | A |
---|---|
table | One unquoted table name for |
The requested table
# For an unzoomed dm you need to specify the table to pull: dm_nycflights13() %>% pull_tbl(airports)#> # A tibble: 1,458 x 8 #> faa name lat lon alt tz dst tzone #> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <chr> <chr> #> 1 04G Lansdowne Airport 41.1 -80.6 1044 -5 A America/New_Yo… #> 2 06A Moton Field Municipal A… 32.5 -85.7 264 -6 A America/Chicago #> 3 06C Schaumburg Regional 42.0 -88.1 801 -6 A America/Chicago #> 4 06N Randall Airport 41.4 -74.4 523 -5 A America/New_Yo… #> 5 09J Jekyll Island Airport 31.1 -81.4 11 -5 A America/New_Yo… #> 6 0A9 Elizabethton Municipal … 36.4 -82.2 1593 -5 A America/New_Yo… #> 7 0G6 Williams County Airport 41.5 -84.5 730 -5 A America/New_Yo… #> 8 0G7 Finger Lakes Regional A… 42.9 -76.8 492 -5 A America/New_Yo… #> 9 0P2 Shoestring Aviation Air… 39.8 -76.6 1000 -5 U America/New_Yo… #> 10 0S9 Jefferson County Intl 48.1 -123. 108 -8 A America/Los_An… #> # … with 1,448 more rows# If zoomed, pulling detaches the zoomed table from the dm: dm_nycflights13() %>% dm_zoom_to(airports) %>% pull_tbl()#> # A tibble: 1,458 x 8 #> faa name lat lon alt tz dst tzone #> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <chr> <chr> #> 1 04G Lansdowne Airport 41.1 -80.6 1044 -5 A America/New_Yo… #> 2 06A Moton Field Municipal A… 32.5 -85.7 264 -6 A America/Chicago #> 3 06C Schaumburg Regional 42.0 -88.1 801 -6 A America/Chicago #> 4 06N Randall Airport 41.4 -74.4 523 -5 A America/New_Yo… #> 5 09J Jekyll Island Airport 31.1 -81.4 11 -5 A America/New_Yo… #> 6 0A9 Elizabethton Municipal … 36.4 -82.2 1593 -5 A America/New_Yo… #> 7 0G6 Williams County Airport 41.5 -84.5 730 -5 A America/New_Yo… #> 8 0G7 Finger Lakes Regional A… 42.9 -76.8 492 -5 A America/New_Yo… #> 9 0P2 Shoestring Aviation Air… 39.8 -76.6 1000 -5 U America/New_Yo… #> 10 0S9 Jefferson County Intl 48.1 -123. 108 -8 A America/Los_An… #> # … with 1,448 more rows