Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check version of library deployed at shinyapps.io

Tags:

r

shiny

I have a shiny app that has been hosted on shinyapps.io for a while.

I downloaded the app and tested locally and one of the features behaves a little differently. I believe that is due to different versions of some libraries.

I wonder if there is a way to check the versions of the libraries of the deployed app so I can install them locally and check.

like image 914
jcp Avatar asked Mar 07 '23 17:03

jcp


2 Answers

I just found out: when you download the app from shinyapps.io you get a json file in the root folder called "manifest.json" that contains all the information about the loaded libraries.

like image 126
jcp Avatar answered Mar 17 '23 20:03

jcp


I have an app that I use on an internal shiny-server for troubleshooting things like this-- this displays system information, library paths, environment variables, and package versions.

Only thing that might causes issues-- I'm not sure if shinyapps.io lets you use the full range of system functions for security reasons?

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)
like image 35
Matt Summersgill Avatar answered Mar 17 '23 20:03

Matt Summersgill