Skip to content

Commit

Permalink
refactor: nitpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
Spinner committed Jan 23, 2025
1 parent 6c7a1ea commit 67e00b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
7 changes: 3 additions & 4 deletions R/utils-slope_selector.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@
dplyr::filter(TYPE %in% c("Selection", "Exclusion")) %>%
semi_join(
profiles %>%
select(USUBJID, ANALYTE, PCSPEC, DOSNO) %>%
rename(PATIENT = USUBJID, PROFILE = DOSNO),
by = c("PATIENT", "ANALYTE", "PCSPEC", "PROFILE")
select(profiles, USUBJID, ANALYTE, PCSPEC, DOSNO),
by = c("PATIENT" = "USUBJID", "ANALYTE", "PCSPEC", "PROFILE" = "DOSNO")
) %>%
filter(all(!is.na(sapply(IXrange, function(x) .eval_range(x)))))
filter(all(!is.na(sapply(IXrange, .eval_range))))

if (nrow(slopes) != 0) {
# Go over all rules and check if there is no overlap - if there is, edit accordingly
Expand Down
6 changes: 3 additions & 3 deletions inst/shiny/modules/slope_selector.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ slope_selector_server <- function(
PCSPEC %in% pcspec_nca,
USUBJID %in% search_patient
) %>%
dplyr::select(USUBJID, ANALYTE, PCSPEC, DOSNO) %>%
select(USUBJID, ANALYTE, PCSPEC, DOSNO) %>%
unique() %>%
dplyr::arrange(USUBJID, ANALYTE, PCSPEC, DOSNO)
arrange(USUBJID, ANALYTE, PCSPEC, DOSNO)

num_plots <- nrow(patient_profile_plot_ids)

Expand All @@ -156,7 +156,7 @@ slope_selector_server <- function(
page_start <- page_end - plots_per_page + 1
if (page_end > num_plots) page_end <- num_plots

plots_to_render <- dplyr::slice(ungroup(patient_profile_plot_ids), page_start:page_end)
plots_to_render <- slice(ungroup(patient_profile_plot_ids), page_start:page_end)

plot_outputs <- apply(plots_to_render, 1, function(row) {
lambda_slope_plot(
Expand Down
4 changes: 2 additions & 2 deletions inst/shiny/modules/tab_visuals.R
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ tab_visuals_server <- function(id, data, grouping_vars, res_nca) {
session,
"analyte_mean",
choices = sort(analyte_choices),
selected = analyte_choices[1]
selected = sort(analyte_choices)[1]
)

# Update the studyidmean select input
Expand All @@ -287,7 +287,7 @@ tab_visuals_server <- function(id, data, grouping_vars, res_nca) {
session,
"pcspec_mean",
choices = sort(pcspec_choices),
selected = pcspec_choices[1]
selected = sort(pcspec_choices)[1]
)

# Update the selectidvar select input
Expand Down

0 comments on commit 67e00b3

Please sign in to comment.