Skip to content

Commit

Permalink
Merge pull request #9 from Boehringer-Ingelheim/rc/v0.0.6
Browse files Browse the repository at this point in the history
Rc/v0.0.6
  • Loading branch information
ml-ebs-ext authored Sep 4, 2024
2 parents b164290 + 7ffbd7c commit 1925694
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.vscode
.vimlocal
.Rproj.user
.Rhistory
*.Rproj
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: dv.explorer.parameter
Type: Package
Title: Parameter exploration modules
Version: 0.0.5
Version: 0.0.6
Authors@R: c(
person("Boehringer-Ingelheim Pharma GmbH & Co.KG", role = c("cph", "fnd")),
person(given = "Luis", family = "Moris Fernandez", role = c("aut", "cre"), email = "[email protected]"),
Expand Down
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# dv.explorer.parameter 0.0.6

* Lineplot:
* Prevent false-positive opaque error message at module startup.

* Correlation heatmap:
* Provide clear error message when handed records with identical subject IDs, category, parameter and visit values.

# dv.explorer.parameter 0.0.5

* First Github release
Expand Down
21 changes: 20 additions & 1 deletion R/mod_corr_hm.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ CH_MSG <- poc( # nolint
N_SUBJECT_EMPTY_RESPONSES = function(x) {
paste(x, "subjects with empty responses!")
},
LESS_THAN_2_PARAMETER = "Please select at least 2 parameters"
LESS_THAN_2_PARAMETER = "Please select at least 2 parameters",
TOO_MANY_ROWS = paste(
"The dataset provided contains repeated rows with identical subject, category, parameter and",
"visit values. This module expects those to be unique. Here are the first few duplicates:"
)
)
)
# UI and server functions
Expand Down Expand Up @@ -555,6 +559,21 @@ corr_hm_server <- function(id,
)
checkmate::assert_factor(bm_dataset()[[VAR$SBJ]], .var.name = ns("bm_dataset"), add = ac)
checkmate::reportAssertions(ac)

supposedly_unique <- bm_dataset()[c(VAR$SBJ, VAR$CAT, VAR$PAR, VAR$VIS)]
dups <- duplicated(supposedly_unique)
shiny::validate(
shiny::need(
!any(dups),
paste0(
c(
CH_MSG$VALIDATE$TOO_MANY_ROWS,
capture.output(print(head(supposedly_unique[dups, ], 5)))
)
)
)
)

bm_dataset()
},
label = ns("v_ch_dataset")
Expand Down
7 changes: 2 additions & 5 deletions R/mod_lineplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -1084,11 +1084,8 @@ lineplot_server <- function(id, # nolint cyclomatic
# Plot type
it_relabel_button(
id = LP_ID$PLOT_BUTTON,
label_if_valid = shiny::reactive({
res <- centrality()
shiny::req(res)
res
})
is_valid = shiny::reactive(test_not_empty(centrality())),
label_if_valid = shiny::reactive(centrality())
)

# Reactivity must be solved inside otherwise the function does not depend on the value
Expand Down

0 comments on commit 1925694

Please sign in to comment.