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

[Bug]: Consistent argument names and defaults #923

Closed
5 tasks done
gogonzo opened this issue Jan 17, 2024 · 1 comment
Closed
5 tasks done

[Bug]: Consistent argument names and defaults #923

gogonzo opened this issue Jan 17, 2024 · 1 comment
Assignees
Labels
bug Something isn't working core sme

Comments

@gogonzo
Copy link
Contributor

gogonzo commented Jan 17, 2024

  • Limit number of unique formals names. tmc modules have 158 unique argument names, some of them might be unified
  • Make a consistent default values wherever possible
  • Make one documentation template for shared arguments (Some shared arguments are documented multiple times)

Please check the table

pkgload::load_all("teal.modules.clinical")
ns <- getNamespace("teal.modules.clinical")
mods <- ls(ns) |>  grep(pattern = "tm_", value = TRUE)
mod_formals <- lapply(mods, function(x) {
  as.data.frame(lapply(formals(x), deparse1))
})


temp <- dplyr::bind_rows(mod_formals)
rownames(temp) <- mods
data <- as.data.frame(t(temp))
data <- dplyr::arrange(data, rownames(data))

data$consistent <- as.vector(
  apply(data, 1, function(x) length(na.omit(unique(x))) <= 1)
)
@gogonzo gogonzo added bug Something isn't working core sme labels Jan 17, 2024
@gogonzo gogonzo mentioned this issue Jan 17, 2024
39 tasks
@donyunardi donyunardi mentioned this issue Jan 17, 2024
38 tasks
@edelarua
Copy link
Contributor

All items completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core sme
Projects
None yet
Development

No branches or pull requests

2 participants