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

Feature Request: Implement consolidate_lookup_tables() #1479

Closed
bundfussr opened this issue Sep 29, 2022 · 2 comments · Fixed by #1671
Closed

Feature Request: Implement consolidate_lookup_tables() #1479

bundfussr opened this issue Sep 29, 2022 · 2 comments · Fixed by #1671
Assignees
Labels
enhancement New feature or request programming

Comments

@bundfussr
Copy link
Collaborator

Feature Idea

Implement

consolidate_lookup_tables <- function(datasets,
                                      source_var = SOURCE,
                                      key_vars)
  • datasets expects a named list of dataset, e.g., datasets = list(company = global_adlb_params, study = adlb_params)
  • key_vars expects a list of variables, e.g., key_vars = vars(LBTESTCD, LBSPEC, LBMETHOD)

The function returns a dataset with one observation per key occurirng in any of the specified dataset. If a key occurs in more than one dataset, the observation from the last dataset is taken. The variable SOURCE should be added to the output dataset and set to the name of the dataset the observations is taken from.

Warnings should be issued if

  • The keys are not a unique key of any of the datasets.
  • The datasets contain different variables.

Relevant Input

No response

Relevant Output

No response

Reproducible Example/Pseudo Code

No response

@bundfussr bundfussr added enhancement New feature or request programming labels Sep 29, 2022
@rossfarrugia
Copy link
Collaborator

@bundfussr i forget the background of this one, but do you think it should be tagged for next release? what's the purpose/impact?

@bundfussr
Copy link
Collaborator Author

@rossfarrugia , the background for this issue is that derive_vars_merged_lookup() expects a single lookup dataset. I.e., if you have different sources, e.g., company parameter mappings and project parameter mappings, these need to be consolidated into a single dataset. This should be done by consolidate_lookup_tables().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request programming
Development

Successfully merging a pull request may close this issue.

2 participants