Skip to content

Add new vignette#68

Merged
osenan merged 13 commits intomainfrom
vignettes-tidyverse@main
May 6, 2026
Merged

Add new vignette#68
osenan merged 13 commits intomainfrom
vignettes-tidyverse@main

Conversation

@osenan
Copy link
Copy Markdown
Contributor

@osenan osenan commented May 5, 2026

Adding a new vignette that explains how to select choices and selected values in picks datasets, variables and values

@osenan osenan added the core label May 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
badge_dropdown 💀 $0.16$ $-0.16$ $-1$ $-1$ $0$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
assertion 👶 $+0.02$ unnamed
badge_dropdown 💀 $0.16$ $-0.16$ shinytest2_badge_dropdown_is_visible_when_clicking_on_it_multiple_times

Results for commit 339cb5c

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

badge

Code Coverage Summary

Filename                  Stmts    Miss  Cover    Missing
----------------------  -------  ------  -------  -------------------------------------------------------------
R/as_picks.R                140      21  85.00%   63, 167-171, 182-186, 201-207, 229-231
R/assertion.R                 5       0  100.00%
R/call_utils.R              147      33  77.55%   23-28, 65, 132-138, 259, 278-289, 292, 317-325
R/helpers.R                  12      12  0.00%    4-15
R/interaction.R              42      26  38.10%   39-97
R/module_merge.R            266      14  94.74%   303, 310-320, 337, 616
R/module_picks.R            318      23  92.77%   47-53, 71, 109-110, 298-300, 302-306, 429, 478, 516, 528, 536
R/picks.R                   183       1  99.45%   335
R/print.R                    36       2  94.44%   50, 58
R/resolver.R                141      19  86.52%   80-83, 110-118, 284-289
R/tidyselect-helpers.R       29       0  100.00%
R/tm_merge.R                 54      54  0.00%    42-102
R/ui_containers.R            42       0  100.00%
R/zzz.R                       5       5  0.00%    3-11
TOTAL                      1420     210  85.21%

Diff against main

Filename      Stmts    Miss  Cover
----------  -------  ------  --------
TOTAL             0       0  +100.00%

Results for commit: 228499e

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Unit Tests Summary

  1 files   10 suites   16s ⏱️
255 tests 241 ✅ 14 💤 0 ❌
383 runs  368 ✅ 15 💤 0 ❌

Results for commit 228499e.

♻️ This comment has been updated with latest results.

@osenan osenan requested a review from a team May 5, 2026 10:55
Comment on lines +18 to +31
## Overview

Every `picks()` object is built from three kinds of building blocks: `datasets()`, `variables()`,
and `values()`. Each one carries two core arguments:

- `choices` — the full set of options the app user can pick from.
- `selected` — the subset that is pre-selected when the app starts.

```
picks(
datasets(choices = <what datasets the user may choose>, selected = <default dataset>),
variables(choices = <what columns the user may choose>, selected = <default columns>),
values(choices = <what values the user may filter to>, selected = <default filter values>)
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need a new vignette, since we already have a vignette with the overall information like this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged to the main vignette here. On the other hand now the vignette is not as short as it used to be.

Comment on lines +34 to +42
Choices and selections can be expressed in three ways:

| Approach | Works with |
|---|---|
| Explicit — character vector, integer index, or numeric range | `datasets()`, `variables()`, `values()` |
| `tidyselect` helpers — `everything()`, `starts_with()`, `where()`, … | `datasets()`, `variables()` only |
| Function — an R function applied at runtime to the data | `datasets()`, `variables()`, `values()` |

The sections below walk through each approach with runnable examples.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just move this information and the below to the main vignette

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in here!


```{r data, message = FALSE}
library(teal.data)
library(teal.picks)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
library(teal.picks)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need 1 of these for the vignette to build :-) it cannot be silent as in examples

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed anyway as the data is loaded by the main vignette

Comment on lines +107 to +109
resolver(x = p_datasets, data = as.list(data))
resolver(x = p_variables, data = as.list(data))
resolver(x = p_values, data = as.list(data))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is resolver an exported funtion? Do user need to know this function?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not need it. Indeed it is confusing. I removed here. It is exported, btw.

Copy link
Copy Markdown
Contributor

@m7pr m7pr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. I would only move this content to the main vignette. Also, I would not mention resolver. No need to call library(teal.picks) since this package is loaded when vignette is compiled.

})

join_keys(data) <- join_keys(
teal.data::join_key("ADSL", "ADLB", keys = "USUBJID")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These datasets are very incomplete, why not use teal.data::rADXX and teal.data::default_cdisc_join_keys[c("ADLB")]

Or add STUDYID to at least have the primary keys.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the teal.data synthetic datasets, as you suggested here. I think it is an improvement

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the teal.data datasets as suggested. Here.


| Approach | Works with |
|---|---|
| Explicit — character vector, integer index, or numeric range | `datasets()`, `variables()`, `values()` |
Copy link
Copy Markdown
Contributor

@averissimo averissimo May 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a default row of what happens when defaults are assumed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice suggestion. Done here.


---

## 1. Explicit choices
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is explicit the right term?

User-defined, static, ?

Should it also reference what happens when choice doesn't exist

resolver(
  teal.picks::picks(teal.picks::datasets("ADSL"), teal.picks::variables(c("yada"))),
  teal.data::teal_data(ADSL = teal.data::rADSL)
)
#' warnings...
#' <picks>
#'   <datasets>:
#'     choices: ADSL
#'     selected: ADSL
#'     multiple=FALSE, ordered=FALSE, fixed=TRUE
#'   <variables>:
#'     choices: ~
#'     selected: ~
#'     multiple=FALSE, ordered=FALSE, fixed=TRUE, allow-clear=FALSE

Comment thread vignettes/teal-picks-choices-and-selections.Rmd Outdated
@osenan osenan requested a review from averissimo May 5, 2026 15:57
Copy link
Copy Markdown
Contributor

@averissimo averissimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there! 🥳

Take special look at the defaults for datasets() as I believe it's not consistent with API documentation and functinality

Comment thread vignettes/teal-picks-in-teal.Rmd Outdated
Comment thread vignettes/teal-picks-in-teal.Rmd Outdated
Comment thread vignettes/teal-picks-in-teal.Rmd Outdated
Comment thread vignettes/teal-picks-in-teal.Rmd Outdated
Comment thread vignettes/teal-picks-in-teal.Rmd Outdated
Comment thread vignettes/teal-picks-in-teal.Rmd Outdated
Comment thread vignettes/teal-picks-in-teal.Rmd Outdated
osenan and others added 7 commits May 5, 2026 18:57
Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
@osenan osenan requested a review from averissimo May 5, 2026 17:10
Copy link
Copy Markdown
Contributor

@averissimo averissimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Please add configuration to pkgdown to show articles index in main page.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make a change in _pkgdown.yml to include all vignettes in site build

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@osenan osenan merged commit dc8572d into main May 6, 2026
27 of 28 checks passed
@osenan osenan deleted the vignettes-tidyverse@main branch May 6, 2026 15:08
@github-actions github-actions Bot locked and limited conversation to collaborators May 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants