简体   繁体   中英

How to publish Shiny?

How to publish the following Shiny code, in which I use my package.

I am not sure, how to publish the following structure's shiny Code. Is it sufficient to upload it as a function? Or I need to divide the following code into ui.R and sever.R and the other materials?

Note that the following function has been already published in my package on CRAN.

fit_GUI_dashboard <- function(
  DF=data.frame(h=c( 97L,   32L,   31L),f=c( 1L ,  14L,   74L )),
  NL.max=1111,
  NI.max=1111,
  MCMC.chains.max=4


){


  outdir <- system.file("myapp", package = "MyPakcage")

  if (outdir == "") {
    stop("Could not find myapp. Try re-installing `MyPakcage`.", call. = FALSE)
  }



  ui1 <- shinydashboard::dashboardPage(

  )#dashboardPage






  server1 <- shiny::shinyServer(function(input, output) {


  })

  ## run app
  shiny::runApp(list(ui=ui1, server=server1))
  return(invisible())
}

Publish means the following:

在此处输入图片说明

I try it, but unknown error occurs and UI is correctly arranged but the program is not running as the following image:

在此处输入图片说明

You are publishing your apps to your shinyapps.io account, so you can check the console logs for your remote R session by logging into your application dashboard on the shinyapps.io site.

After logging in and selecting your application, click on the "Logs" button towards the upper-righthand section of the screen (visible in below screenshot). The log will tell you exactly what the error is: it may be a referenced variable that's not loaded by your script, a package dependency that needs to be explicitly installed on your remote server, or something else entirely. The error message will give you more information.

Shinyapps.io应用程序仪表板

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM