Advertisement
Guest User

shinyfilereader

a guest
Jun 27th, 2016
675
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. ############################
  2. # ui.R:
  3. #############################
  4.  
  5. ## ui.R ##
  6. library(shiny)
  7. library(shinydashboard)
  8. library(DT)
  9. jsfile <- "unitfix.js"
  10.  
  11. shinyUI(dashboardPage(
  12. dashboardHeader(title = img(src="logo5.png", height = 32, align = "middle")),
  13. dashboardSidebar(),
  14. dashboardBody(
  15. tags$head(tags$link(rel = "stylesheet", type="text/css", href="bootstrap.css")),
  16. tags$head(HTML("<script type=\"text/javascript\" src=\"unitpngfix.js\"></script>")),
  17. fluidRow(
  18. h4("Touch / No Touch"),
  19. infoBox("ECC", icon = icon("ok", lib = "glyphicon"), width = 2, color = "green"),
  20. infoBox("DOC", icon = icon("thumbs-up", lib = "glyphicon"), width = 2, color = "green"),
  21. infoBox("CCC", icon = icon("thumbs-up", lib = "glyphicon"), width = 2, color = "green"),
  22. infoBox("GEN", icon = icon("thumbs-up", lib = "glyphicon"), width = 2, color = "green"),
  23. infoBox("IT", icon = icon("thumbs-up", lib = "glyphicon"), width = 2, color = "green")
  24. ),
  25. fluidRow(
  26. tabBox (
  27. tabPanel(
  28. title = "PRI-1 Incidents Previous Period",
  29. dataTableOutput('PRI1LastPeriodTable')
  30. ),
  31. tabPanel(
  32. title = "PRI-1 Incidents Currently Open"
  33. ),
  34. tabPanel(
  35. title = "Security Status"
  36. ),
  37. tabPanel(
  38. title = "Previous Period's Work - Completed"
  39. ),
  40. tabPanel(
  41. title = "Panned / Ongoing Work - CAB Approved"
  42. ),
  43. tabPanel(
  44. title = "Panned / Ongoing Work - Waiting CAB Approval"
  45. ),
  46. tabPanel(
  47. title = "Facilities"
  48. ),
  49. tabPanel(
  50. title = "Operational Events"
  51. ),
  52. tabPanel(
  53. title = "Staff Locations"
  54. ),
  55. tabPanel(
  56. title = "Weather"
  57. ),
  58. width = 12
  59. )
  60. )
  61. )
  62. )
  63. )
  64.  
  65.  
  66. #########################
  67. # server.R
  68. #########################
  69.  
  70. ## server.R ##
  71. library(shiny)
  72. library(shinydashboard)
  73. library(DT)
  74.  
  75. #load("W:/Projects/R/Scripts/ITPOD/itpod/data/prioirtyOneIncidentsLastPeriod.RData", envir = .GlobalEnv)
  76.  
  77. shinyServer(function(input, output) {
  78.  
  79. output$PRI1LastPeriodTable <- renderDataTable({
  80. prioirtyOneIncidentsLastPeriodTable <- fileReaderILP
  81. },
  82. escape=FALSE,
  83. rownames = FALSE
  84. )
  85. })
  86.  
  87. #############################
  88. # global.R
  89. #############################
  90.  
  91. library(data.table)
  92.  
  93. # Local files for development/testing
  94.  
  95. fileReaderILP <- reactiveFileReader(500, session=NULL, filePath = "W:/Projects/R/Scripts/ITPOD/itpod/data/prioirtyOneIncidentsLastPeriod.RData", load, envir=.GlobalEnv)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement