Source code for SMARTsize, an online sample size calculator for SMARTs with end-of-study continuous or binary outcomes.
The application is available online at https://nseewald1.shinyapps.io/SMARTsize/. It can also be run locally.
Paste the following code into an R console:
reqPackages <- c("devtools", "shiny", "shinyBS", "DiagrammeR", "shinyjs")
installList <- !(reqPackages %in% installed.packages())
if (any(installList)) {
install.packages(reqPackages[installList])
}
library(shiny)
shiny::runGitHub("nseewald1/SMARTsize")
- ui.R: Defines the user interface for the application, including inputs/outputs, etc.
- server.R: Defines the backend for the user interface; connects inputs to appropriate functions to return outputs.
- global.R: Contains
sampleSize
andABcomp
functions for computing sample size, as well as other "non-reactive" helper functions for use throughout the app.