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

General Issue: Improve messaging in derive_extreme_event() #2405

Closed
bundfussr opened this issue Apr 11, 2024 · 1 comment · Fixed by #2454
Closed

General Issue: Improve messaging in derive_extreme_event() #2405

bundfussr opened this issue Apr 11, 2024 · 1 comment · Fixed by #2454
Assignees

Comments

@bundfussr
Copy link
Collaborator

Background Information

The messaging in derive_extreme_event() should be improved. Consider the following example.

ad1 <- tribble(
  ~USUBJID, ~AVALC, ~ADY, ~ASEQ,
  "1",      "Y",       3,     1,
  "1",      "Y",       3,     2,
  "2",      "Y",       5,     1,
  "3",      "N",       2,     1,
  "4",      "N",       4,     1
)

ad2 <- tribble(
  ~USUBJID, ~AVALC, ~ADY, ~ASEQ,
  "1",      "Y",       3,     1,
  "2",      "Y",       3,     1,
  "3",      "Y",       2,     1
)

derive_extreme_event(
  by_vars = exprs(USUBJID),
  source_datasets = list(ad1 = ad1, ad2 = ad2),
  order = exprs(event_nr, ADY),
  mode = "first",
  tmp_event_nr_var = event_nr,
  events = list(
    event(
    dataset_name = "ad1",
    condition = AVALC == "Y",
    mode = "first",
    set_values_to = exprs(
      event_nr = 1,
      AVALC = "Y"
    )
    ),
    event(
      dataset_name = "ad2",
      condition = AVALC == "Y",
      mode = "first",
      set_values_to = exprs(
        event_nr = 1,
        AVALC = "Y"
      )
    ),
    event(
      dataset_name = "ad1",
      mode = "last",
      set_values_to = exprs(
        event_nr = 2,
        AVALC = "N"
      )
    )
  )
)

It creates the following warnings.

Warning messages:
1: Dataset contains duplicate records with respect to `USUBJID`, `event_nr` and `ADY`
Run `get_duplicates_dataset()` to access the duplicate records 
2: Dataset contains duplicate records with respect to `USUBJID`, `event_nr` and `ADY`
Run `get_duplicates_dataset()` to access the duplicate records 
3: Dataset contains duplicate records with respect to `USUBJID`, `event_nr` and `ADY`
Run `get_duplicates_dataset()` to access the duplicate records 

That's not user-friendly because

  • It is not clear to which dataset the warnings are referring to. One of the input datasets or a temporary dataset created in the function?
  • Only the duplicate records from the last warning are accessible. The others are overwritten.

Definition of Done

The function is updated such that the issues mentioned above are resolved.

@manciniedoardo
Copy link
Collaborator

Apologies, referenced this issue in a PR by mistake!

@jeffreyad jeffreyad self-assigned this May 24, 2024
@jeffreyad jeffreyad linked a pull request May 30, 2024 that will close this issue
15 tasks
jeffreyad pushed a commit that referenced this issue May 30, 2024
jeffreyad pushed a commit that referenced this issue Jun 3, 2024
jeffreyad pushed a commit that referenced this issue Jun 3, 2024
jeffreyad pushed a commit that referenced this issue Jun 4, 2024
bms63 pushed a commit that referenced this issue Jun 4, 2024
#2454)

* #2405 update messaging for duplicates in derive_extreme_event()

* #2405 update for lint

* Update R/derive_extreme_event.R

Co-authored-by: Stefan Bundfuss <80953585+bundfussr@users.noreply.github.com>

* #2405 update cnd_type to check_type

* #2405 update tests

* Update R/derive_extreme_event.R

Co-authored-by: Stefan Bundfuss <80953585+bundfussr@users.noreply.github.com>

* #2405 add check_type = "none" to filter_extreme()

* #2405 update filter_joined()

---------

Co-authored-by: Jeffrey Dickinson <dickinson.jeffrey@gene.com>
Co-authored-by: Stefan Bundfuss <80953585+bundfussr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants