#' @title Load the main menu for the modelbuilder package
#'
#' @description This function opens a shiny app menu which allows the user to build or analyze models
#'
#' @details Run this function with no arguments to start the main menu
#' @examples
#' \dontrun{modelbuilder()}
#' @author Andreas Handel
#' @import shiny
#' @export
modelbuilder <- function() {
cond <- 1
while (cond == 1)
{
appname <- NULL
appDir <- system.file("modelbuilder", package = "modelbuilder")
appname = shiny::runApp(appDir = appDir, launch.browser= TRUE)
if (!is.null(appname) & appname != "Exit") #run the shiny app chosen
{
appDirname <- system.file(appname, package = "modelbuilder")
shiny::runApp(appDir = appDirname, launch.browser= TRUE)
}
if (appname == "Exit") {cond = 0} #leave while loop/menu
}
print('*************************************************')
print('Exiting the modelbuilder interface.')
print('Good luck with all your modeling efforts!')
print('*************************************************')
}
#needed to prevent NOTE messages on CRAN checks
utils::globalVariables(c("xvals", "yvals", "varnames","IDvar","style","time","xcenter","ycenter"))
.onAttach <- function(libname, pkgname) {
welcometext <- paste0(' Welcome to the modelbuilder package. \n This is version ',utils::packageVersion('modelbuilder'),' last updated ', utils::packageDescription('modelbuilder')$Date,'. \n Type modelbuilder() to get started.')
packageStartupMessage(welcometext)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.