Skip to content

Commit

Permalink
Merge pull request #269 from OHDSI/bug_counts
Browse files Browse the repository at this point in the history
fix bug with formatted numbers
  • Loading branch information
edward-burn authored Feb 3, 2025
2 parents 6694d82 + 12e7fb9 commit dc26634
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions inst/shiny/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ server <- function(input, output, session) {
# suppressed to NA
tbl <- tbl |>
purrr::map_df(~ ifelse(grepl("^<", .), NA, .)) |>
dplyr::mutate(dplyr::across(c(ends_with("Record count"), ends_with("Person count")),
dplyr::mutate(dplyr::across(c(ends_with("count")),
~ gsub(",", "", .))) |>
dplyr::mutate(dplyr::across(c(ends_with("count")),
~ suppressWarnings(as.numeric(.))))
tbl <- reactable(tbl,
defaultSorted = order,
Expand Down Expand Up @@ -273,7 +275,9 @@ server <- function(input, output, session) {
# suppressed to NA
tbl <- tbl |>
purrr::map_df(~ ifelse(grepl("^<", .), NA, .)) |>
dplyr::mutate(dplyr::across(c(ends_with("Record count"), ends_with("Person count")),
dplyr::mutate(dplyr::across(c(ends_with("count")),
~ gsub(",", "", .))) |>
dplyr::mutate(dplyr::across(c(ends_with("count")),
~ suppressWarnings(as.numeric(.))))

tbl <- reactable(tbl,
Expand Down Expand Up @@ -405,7 +409,9 @@ server <- function(input, output, session) {
return(tbl)
} else {
tbl <- createCohortCodeUseInteractive() |>
dplyr::mutate(dplyr::across(c(ends_with("Record count"), ends_with("Person count")),
dplyr::mutate(dplyr::across(c(ends_with("count")),
~ gsub(",", "", .))) |>
dplyr::mutate(dplyr::across(c(ends_with("count")),
~ suppressWarnings(as.numeric(.))))

# column ordering by codelist and first column with a count
Expand Down

0 comments on commit dc26634

Please sign in to comment.