From 524d7a21563cab2820c6da3c6663dbcd923873bb Mon Sep 17 00:00:00 2001 From: pchelle Date: Thu, 30 Nov 2023 11:30:35 -0500 Subject: [PATCH] Fixes #1097 update demography caption New populations such as disease states will be included in later versions --- R/captions.R | 10 ++--- inst/extdata/obsPop.csv | 84 ++++++++++++++++++++-------------------- vignettes/demography.Rmd | 43 ++++++++++++++++++++ 3 files changed, 89 insertions(+), 48 deletions(-) diff --git a/R/captions.R b/R/captions.R index aa90a4ea..0de4a978 100644 --- a/R/captions.R +++ b/R/captions.R @@ -80,12 +80,10 @@ captions <- list( referenceSetText, ". ", dataSource, - getPlotScaleCaption("Profiles", plotScale), switch(parameterClass, - "character" = paste0(" and ", getBoxplotDescriptor()), - "" - ), - "." + "character" = paste0("Data is ", getBoxplotDescriptor(), "."), + getPlotScaleCaption("Profiles", plotScale) + ) )) } ), @@ -228,7 +226,7 @@ getDataSourceCaption <- function(structureSet) { return("") } dataSourceCaption <- structureSet$simulationSet$dataSource$getCaption(structureSet$workflowFolder) - return(paste0(dataSourceCaption, ". ")) + return(dataSourceCaption) } getGoodnessOfFitCaptions <- function(structureSet, plotType, plotScale = "linear", settings = NULL) { diff --git a/inst/extdata/obsPop.csv b/inst/extdata/obsPop.csv index b1c13793..8dc50f67 100644 --- a/inst/extdata/obsPop.csv +++ b/inst/extdata/obsPop.csv @@ -1,43 +1,43 @@ ID,GENDER,POP,WEIGHT,AGE -0,MALE,Adults,52,20 -1,MALE,Adults,48,13 -2,MALE,Adults,56,14 -3,MALE,Children,33,10 -4,MALE,Adults,87,37 -5,MALE,Adults,52,16 -6,MALE,Adults,64,25 -7,MALE,Adults,65,21 -8,MALE,Adults,66,27 -9,MALE,Adults,43,12 -10,MALE,Adults,51,14 -11,MALE,Adults,60,35 -12,MALE,Adults,66,14 -13,MALE,Adults,43,12 -14,MALE,Children,25,7 -15,MALE,Adults,80,40 -16,MALE,Adults,66,33 -17,FEMALE,Adults,50,20 -18,FEMALE,Adults,41,19 -19,FEMALE,Adults,58,34 -20,FEMALE,Adults,50,16 -21,FEMALE,Children,21,8 -22,FEMALE,Adults,86,23 -23,FEMALE,Adults,76,23 -24,FEMALE,Adults,68,27 -25,FEMALE,Adults,64,19 -26,FEMALE,Adults,40,16 -27,FEMALE,Adults,64,19 -28,FEMALE,Adults,72,40 -29,FEMALE,Adults,65,40 -30,FEMALE,Adults,46,19 -31,FEMALE,Adults,45,13 -32,FEMALE,Adults,64,38 -33,FEMALE,Adults,34,12 -34,FEMALE,Adults,48,14 -35,FEMALE,Adults,64,37 -36,FEMALE,Adults,58,38 -37,FEMALE,Adults,43,13 -38,FEMALE,Adults,63,15 -39,FEMALE,Adults,47,15 -40,FEMALE,Adults,61,34 -41,FEMALE,Adults,52,37 +0,MALE,Adults,52,16 +1,MALE,Children,48,9 +2,MALE,Children,56,10 +3,MALE,Children,33,6 +4,MALE,Adults,87,33 +5,MALE,Children,52,12 +6,MALE,Adults,64,21 +7,MALE,Adults,65,17 +8,MALE,Adults,66,23 +9,MALE,Children,43,8 +10,MALE,Children,51,10 +11,MALE,Adults,60,31 +12,MALE,Children,66,10 +13,MALE,Children,43,8 +14,MALE,Children,25,3 +15,MALE,Adults,80,36 +16,MALE,Adults,66,29 +17,FEMALE,Adults,50,16 +18,FEMALE,Adults,41,15 +19,FEMALE,Adults,58,30 +20,FEMALE,Children,50,12 +21,FEMALE,Children,21,4 +22,FEMALE,Adults,86,19 +23,FEMALE,Adults,76,19 +24,FEMALE,Adults,68,23 +25,FEMALE,Adults,64,15 +26,FEMALE,Children,40,12 +27,FEMALE,Adults,64,15 +28,FEMALE,Adults,72,36 +29,FEMALE,Adults,65,36 +30,FEMALE,Adults,46,15 +31,FEMALE,Children,45,9 +32,FEMALE,Adults,64,34 +33,FEMALE,Children,34,8 +34,FEMALE,Children,48,10 +35,FEMALE,Adults,64,33 +36,FEMALE,Adults,58,34 +37,FEMALE,Children,43,9 +38,FEMALE,Children,63,11 +39,FEMALE,Children,47,11 +40,FEMALE,Adults,61,30 +41,FEMALE,Adults,52,33 diff --git a/vignettes/demography.Rmd b/vignettes/demography.Rmd index 71ce26ff..07b9b996 100644 --- a/vignettes/demography.Rmd +++ b/vignettes/demography.Rmd @@ -621,6 +621,49 @@ It is however possible to remove this settings in case the bars do not overlap b workflow$plotDemography$settings$dodge <- FALSE ``` +In the example below, dodging is removed within a parallel comparison workflow: + +
+ __Code__ + +```{r} +parallelWorkflow <- PopulationWorkflow$new( + workflowType = PopulationWorkflowTypes$parallelComparison, + simulationSets = c(adultSet, childrenSet), + workflowFolder = "Parallel-Histograms", + createWordReport = FALSE +) + +inactivateWorkflowTasks(parallelWorkflow) +activateWorkflowTasks(parallelWorkflow, tasks = AllAvailableTasks$plotDemography) + +displayedParameters <- list( + Age = "Organism|Age", + Weight = "Organism|Weight", + Gender = "Gender" + ) +setYParametersForDemogrpahyPlot(workflow = parallelWorkflow, parameters = displayedParameters) + +# Turn off dodging of histogram bars +parallelWorkflow$plotDemography$settings$dodge <- FALSE + +parallelWorkflow$runWorkflow() + +``` + +
+ + +```{r example parallel report dodge, echo=FALSE, results='asis'} +cat(includeReportFromWorkflow(parallelWorkflow)) +``` + +```{r delete parallel report dodge, include = FALSE, echo=FALSE} +# Remove the workflow folders +unlink(parallelWorkflow$workflowFolder, recursive = TRUE) +``` + + ## Display reference population global range Pediatric workflow range plots compare simulation sets to the **reference** simulation set ([#17](https://github.com/Open-Systems-Pharmacology/OSPSuite.ReportingEngine/issues/17)).