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

data_extract_spec enhancements #2

Open
nikolas-burkoff opened this issue Jan 19, 2022 · 1 comment
Open

data_extract_spec enhancements #2

nikolas-burkoff opened this issue Jan 19, 2022 · 1 comment

Comments

@nikolas-burkoff
Copy link
Contributor

nikolas-burkoff commented Jan 19, 2022

From insightsengineering/teal#436 (comment)

[The specific form of the arguments such as all() and list() are just examples]

  • Would be great to specify say data_extract_spec(<>, filter_spec = list()) to just get the select and vice versa

  • Would be great to specify say data_extract_spec(<>, col_types = c("numeric", "date")) where the select/filter_spec is populated with only numeric/date columns

  • Would be great to say specify data_extract_spec(all(), ...) to get UI where you can select from all datanames (at the moment data_extract_spec needs a single dataset but the api could be changed to handle this more smoothly)

After all of these in tmg the default arguments for the modules could be chosen sensibly so defining apps could be so simpler:

E.g. tm_outliers could have default args:

tm_outliers<- function( ...
  outlier_var = data_extract_spec(all(), filter_spec = list(), col_types = c("numeric"),
  categorical_var = data_extract_spec(all(), select_spec = list(), col_types = c("factor"),
 ...
) { ... }

Then app developers could just use tm_outliers() 🥳

@kpagacz
Copy link
Contributor

kpagacz commented Jan 19, 2022

We have something like all() already in teal. It's all_choices(): https://github.com/insightsengineering/teal/blob/main/R/all_choices.R

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