cynkra / dm

Working with relational data models in R
https://dm.cynkra.com
Other
500 stars 50 forks source link

update doc of 'dm_update_zoomed()' #403

Closed TSchiefer closed 3 years ago

TSchiefer commented 4 years ago

...or adapt implementation.

From the documentation: dm_update_zoomed() overwrites the originally zoomed table with the manipulated table. The filter conditions for the zoomed table are added to the original filter conditions.

Behavior:

suppressPackageStartupMessages({
  library(dm)
  library(tibble)
  library(dplyr)
})
dm(t1 = tibble(a = 1:10)) %>% 
  dm_zoom_to(t1) %>% 
  filter(a > 5) %>% 
  dm_update_zoomed() %>% 
  dm:::get_filter_for_table("t1")
#> # A tibble: 0 x 2
#> # … with 2 variables: filter_expr <list>, zoomed <lgl>

# if there already was a filter condition beforehand, it stays:
test <- dm(t1 = tibble(a = 1:10)) %>% 
  dm_filter(t1, a < 7) %>% 
  dm_zoom_to(t1) %>% 
  filter(a > 5) %>% 
  dm_update_zoomed() %>% 
  dm:::get_filter_for_table("t1")
test
#> # A tibble: 1 x 2
#>   filter_expr  zoomed
#>   <named list> <lgl> 
#> 1 <language>   FALSE
test$filter_expr
#> [[1]]
#> a < 7

Created on 2020-06-13 by the reprex package (v0.3.0)

krlmlr commented 4 years ago

No longer relevant if filter expressions are going away (#426), need to skim all documentation for "[Ff]ilter".

github-actions[bot] commented 2 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.