Skip to content

Commit

Permalink
Fix #866 (#867)
Browse files Browse the repository at this point in the history
* Fix #866

* [skip style] [skip vbump] Restyle files

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
Puzzled-Face and github-actions[bot] authored Oct 14, 2024
1 parent 4d3d3d4 commit ff1a377
Show file tree
Hide file tree
Showing 6 changed files with 686 additions and 665 deletions.
22 changes: 18 additions & 4 deletions R/Data-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ setMethod(
f = "tidy",
signature = signature(x = "DataOrdinal"),
definition = function(x, ...) {
tibble::tibble(
y <- tibble::tibble(
ID = x@ID,
Cohort = x@cohort,
Dose = x@x,
Expand All @@ -1000,8 +1000,22 @@ setMethod(
values_from = "Tox",
names_prefix = "Cat",
values_fill = 0
) %>%
dplyr::mutate(dplyr::across(tidyselect::matches("Cat\\d+"), \(x) x > 0)) %>%
h_tidy_class(x)
)
if (nrow(y) > 0) {
y <- y %>%
dplyr::mutate(
dplyr::across(tidyselect::matches("Cat\\d+"), \(x) x > 0)
) %>%
dplyr::rowwise() %>%
dplyr::mutate(
AnyTox = any(dplyr::across(c(tidyselect::starts_with("Cat"), -Cat0), any)),
# Direct assignment fails on GitHub
Cat0 = !AnyTox
) %>%
dplyr::select(-AnyTox) %>%
dplyr::ungroup()
}
y <- y %>% h_tidy_class(x)
y
}
)
Loading

0 comments on commit ff1a377

Please sign in to comment.