A Shiny app for creating, editing and diagnosing research designs.
Installing dependencies using renv
DDWizard employs renv and we recommend using it, when you want to run DDWizard on your computer. If you haven't installed renv yet, please do so by running
install.packages('renv'). After that, open the DDWizard RStudio project and run:
This will install all required packages in an isolated package environment for DDWizard, i.e. it will not mess with your existing R package versions. Every time you open the DDWizard RStudio project, this package environment will be used.
List of dependencies
All dependencies are listed in the file
Overview of files
This shiny app displays several tabs, each of which is a separate shiny module (http://shiny.rstudio.com/articles/modules.html) implemented in the respective "tab_ ... .R" file. Hence
app.R only implements the "skeleton" of the application.
app.R: Shiny application skeleton
tab_design.R: "Design" tab for loading and manipulating existing designs
tab_inspect.R: "Diagnose" tab for visual design inspection
common.R: Common utility functions
inspect_helpers.R: Utility functions for design inspection
uihelpers.R: UI related utility functions
conf.R: Configuration options
_docs folder contains the following documentation files that provide an overview:
ddnotes.Rmd: introduces designers from the DesignLibrary package from a DDWizard development perspective; read this first
app_structure.Rmd: gives and overview about the source code structure for DDWizard and some details that are quite specific for this app such as use of namespaces, use of Shiny UI extension packages as well as some notes on reactivity and running diagnoses
Unit tests are implemented in the tests folder with RUnit.
A shortcut to run all tests was added to the Makefile so you can run in the console:
Functional tests with shinytest
We tried to setup shinytest for DDWizard to record app states and then replay them to check automatically if (and where) the app doesn't provide the expected output if we changed the source or updated one of its dependency packages. Unfortunately, shinytest doesn't work well with our app and will fail with an already reported error for all but the very simplest test, which is available in
Once the shinytest package works with our package, we should generate more test cases like this:
library(shinytest) recordTest(seed = 1234) # setting a seed is important since simulations need to be the same
And test them via:
library(shinytest) testApp() # optionally provide `testnames = ...`