Skip to content

Commit

Permalink
Remove percentage calculation from records field in cd ieb
Browse files Browse the repository at this point in the history
  • Loading branch information
azimov committed Oct 1, 2024
1 parent 942c6ea commit 56ed305
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions R/cohort-diagnostics-indexEventBreakdown.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ indexEventBreakdownView <- function(id) {
shiny::tags$td(
shiny::checkboxInput(
inputId = ns("showAsPercent"),
label = "Show as percentage",
label = "Show persons as percentage",
value = TRUE
)
)
Expand Down Expand Up @@ -232,17 +232,20 @@ indexEventBreakdownModule <- function(id,
if (showDataAsPercent) {
data <- data %>%
dplyr::rename(
"persons" = "subjectPercent",
"records" = "conceptPercent"
"persons" = "subjectPercent"
)
} else {
data <- data %>%
dplyr::rename(
"persons" = "subjectCount",
"records" = "conceptCount"
"persons" = "subjectCount"
)
}

data <- data %>%
dplyr::rename(
"records" = "conceptCount"
)

data <- data %>%
dplyr::arrange(dplyr::desc(abs(dplyr::across(
c("records", "persons")
Expand Down Expand Up @@ -278,6 +281,7 @@ indexEventBreakdownModule <- function(id,
countLocation = countLocation,
dataColumns = dataColumnFields,
showDataAsPercent = showDataAsPercent,
excludedColumnFromPercentage = "records",
sort = TRUE
)
})
Expand Down

0 comments on commit 56ed305

Please sign in to comment.