Skip to content

Commit

Permalink
feat: convert subgroup variables to factors instead of erroring
Browse files Browse the repository at this point in the history
  • Loading branch information
overdodactyl committed Oct 25, 2024
1 parent f7417a7 commit 4153bb0
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: diagnosticSummary
Title: Diagnostic Summaries
Version: 0.0.2.00
Version: 0.0.2.10
Authors@R:
c(person(given = "Pat",
family = "Johnson",
Expand Down Expand Up @@ -31,7 +31,7 @@ Suggests:
caret,
broom,
tibble
RoxygenNote: 7.1.2
RoxygenNote: 7.3.1
Language: en-US
URL: https://overdodactyl.github.io/diagnosticSummary/, https://github.com/overdodactyl/diagnosticSummary/
Roxygen: list(markdown = TRUE)
4 changes: 2 additions & 2 deletions R/dx_constructor.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' with 1 being the event
#' @param outcome_label Label for outcome (string)
#' @param grouping_variables Character vector of variable names to
#' be summarized by. These variables should all be factors.
#' be summarized by. Variables are converted to factors if not already one.
#' @param citype Confidence interval type.
#' @param bootreps Number of bootstrap samples used to generate F1 score CI
#' @param bootseed Seed value to be used when calculating bootsraped CI's
Expand Down Expand Up @@ -46,7 +46,7 @@ dx <- function(data,
if (!identical(grouping_variables, NA)) {
for (f in grouping_variables) {
if (!is.factor(data[[f]])) {
stop("All variables in `grouping_variables` should be a factor.")
data[[f]] <- as.factor(data[[f]])
}
}
}
Expand Down
18 changes: 18 additions & 0 deletions man/diagnosticSummary.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/dx.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/dx_z_test.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4153bb0

Please sign in to comment.