检查在shinyapps.io

时间:2018-03-07 17:03:05

标签: r shiny

我有一个闪亮的应用程序已经在shinyapps.io上托管了一段时间。

我下载了应用并在本地进行了测试,其中一项功能的表现略有不同。我相信这是由于某些库的不同版本。

我想知道是否有办法检查已部署应用的库的版本,以便我可以在本地安装并检查。

2 个答案:

答案 0 :(得分:3)

我有一个应用程序,我在内部shiny-server上使用这个应用程序进行故障排除 - 显示系统信息,库路径,环境变量和包版本。

只有可能导致问题的事情 - 我不确定shinyapps.io是否允许您出于安全原因使用所有系统功能?

library(shiny)
library(shinydashboard)

# UI----------------------------------------------------------------------------
ui <- dashboardPage(
  title = "Test Local App Config",
  dashboardHeader(title = "Local App Config"),
  dashboardSidebar(
    sidebarMenu(id = "sidebarmenu",
                menuItem("Main", tabName = "main", icon = icon("dashboard")
                ) ## end sidebarMenu
    ) ## end dashboardSidebar
  ),
  # UI Body --------------------------------------------------------------------
  dashboardBody(
    tabItems(
      tabItem(tabName = "main",
              fluidRow(
                column(width = 6,
                       box(
                         title = "Sys.info()",
                         status = "primary",solidHeader = TRUE,width = NULL,
                         shiny::tableOutput("info")
                       ),
                       box(
                         title = ".libPaths()",
                         status = "primary",solidHeader = TRUE,width = NULL,
                         shiny::tableOutput("libpaths")
                       ),
                       box(
                         title = "Sys.getenv()",
                         status = "primary",solidHeader = TRUE,width = NULL,
                         shiny::tableOutput("getenv")
                       )

                ),
                column(width = 6,
                       box(
                         title = "Packages",
                         status = "primary",solidHeader = TRUE,width = NULL,
                         shiny::tableOutput("packages")
                       ))
              )
      ) ## end tabItem "main"
    ) ## end tabItems
  ) ## end dashboardBody
) ## end dashboardPage


# Server ------------------------------------------------------------------------

server <-  function(input,output){
  output$info <- renderTable({
    data.frame(Variable = names(Sys.info()),
               Value = as.character(Sys.info()))
  })

  output$libpaths <- renderTable({
    data.frame(Paths = as.character(.libPaths()))
  })

  output$getenv <- renderTable({
    data.frame(Variable = names(Sys.getenv()),
               Value = as.character(Sys.getenv()))
  })

  output$packages <- renderTable({
    data.frame(installed.packages())[,.(Package,Version,Built,LibPath)]
  })



}

shinyApp(ui = ui, server = server)

答案 1 :(得分:2)

我刚刚发现:当您从shinyapps.io下载应用程序时,您会在名为“manifest.json”的根文件夹中获得一个json文件,其中包含有关已加载库的所有信息。

相关问题