Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Way to create custom labels for segments #451

Closed
2 tasks done
Aariq opened this issue Dec 5, 2022 · 2 comments
Closed
2 tasks done

Way to create custom labels for segments #451

Aariq opened this issue Dec 5, 2022 · 2 comments

Comments

@Aariq
Copy link

Aariq commented Dec 5, 2022

Prework

Proposal

Currently the segment that the validation step is operating on is only visible in the interrogation table by mousing over the TBL column. It would be nice to be able to access that information to make it more visible, for example by adding custom labels. I could imagine using glue syntax possibly:

small_table |> 
  create_agent() |> 
  col_vals_lt(
    c, 8,
    segments = vars(f),
    label = "The `col_vals_lt()` step for group '{.segment}'"
  ) |> 
  interrogate()

Just an idea

@yjunechoe
Copy link
Collaborator

Thanks for the suggestion! In dev, you can now do something like:

remotes::install_github("rstudio/pointblank")
library(pointblank)

agent <- create_agent(small_table) %>%  
  col_vals_lt(
    columns = c(a, c),
    value = 8,
    segments = vars(e, f),
    label = "`{.step}()` step for values in column {.col} within the segment {.seg_col}:{.seg_val}"
  ) %>% 
  interrogate()

cat(agent$validation_set$label, sep = "\n")
#> `col_vals_lt()` step for values in column a within the segment e:TRUE
#> `col_vals_lt()` step for values in column a within the segment e:FALSE
#> `col_vals_lt()` step for values in column a within the segment f:high
#> `col_vals_lt()` step for values in column a within the segment f:low
#> `col_vals_lt()` step for values in column a within the segment f:mid
#> `col_vals_lt()` step for values in column c within the segment e:TRUE
#> `col_vals_lt()` step for values in column c within the segment e:FALSE
#> `col_vals_lt()` step for values in column c within the segment f:high
#> `col_vals_lt()` step for values in column c within the segment f:low
#> `col_vals_lt()` step for values in column c within the segment f:mid

@rich-iannone
Copy link
Member

Thanks for being patient on this @Aariq , and huge thanks to @yjunechoe for making this (and much more) possible!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants