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

Access intervention names #189

Open
pratikunterwegs opened this issue Mar 7, 2024 · 0 comments
Open

Access intervention names #189

pratikunterwegs opened this issue Mar 7, 2024 · 0 comments
Assignees
Labels
Interventions Related to implementing interventions

Comments

@pratikunterwegs
Copy link
Collaborator

This issue requests a function to more easily access intervention names. An alternative is to have c.*_intervention() construct names by combining component names.

It could save users lots of time to have a helper function to automatically extract from the intervention_scenarios object, e.g.

extract_names <- function(scenario) {
  names <- sapply(scenario, function(x) x$name)
  paste(names, collapse = " + ")
}

labels <- sapply(intervention_scenarios, extract_names)
labels[names(labels)=="baseline"] <- "None"

Although have noticed that combined_intervention just pulls the name of the first one included. Perhaps neater for this vignette to define like the other combined scenarios? Unless I'm missing an easy way to grab both intervention names?

Originally posted by @adamkucharski in #176 (comment)

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

No branches or pull requests

1 participant