【问题标题】:Check version of library deployed at shinyapps.io检查在 shinyapps.io 部署的库版本
【发布时间】:2018-03-08 04:52:17
【问题描述】:

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

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

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

【问题讨论】:

    标签: r shiny


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      我有一个应用程序,我在内部 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)
      

      【讨论】:

        猜你喜欢
        • 2017-09-05
        • 2021-02-06
        • 2018-06-28
        • 1970-01-01
        • 2021-06-13
        • 2016-05-23
        • 2015-06-27
        • 2019-05-18
        • 1970-01-01
        相关资源
        最近更新 更多