Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rc/v0.0.6 #9

Merged
merged 5 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 repeat rows with identical subject, category, parameter and",
ml-ebs-ext marked this conversation as resolved.
Show resolved Hide resolved
"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