For the "Treatment Models" tab there should be a table but it is not displaying. It works locally but not when I publish it.
here is my code:
library(shiny)
library(shinydashboard)
library(RCurl) #package for the get URL function
library(foreign)
library(httr) # to embed HTML documents in Shiny
dashboardPage(skin = "purple",
dashboardHeader(title= "CAMH NDS-STOP"), #Insert the Main Title
# titleWidth = 350), #Longer Title Width
dashboardSidebar(
sidebarMenu(
menuItem("Objective", tabName= "first", icon= icon("info-circle")),
menuItem("History", tabName="second", icon=icon("clock-o")),
menuItem("Treatment Models", tabName = "third", icon=icon("user-md")),
menuItem("References/Resources", tabName="last", icon=icon("book"))
)),
dashboardBody(
tabItems(
tabItem(tabName= "first",
htmlOutput("includeHTML")
),
tabItem(tabName="second",
img(src="History_STOP.jpg")
),
tabItem(tabName="third",
h4("Since 2005, the program has investigated 15 models of distributing free cessation medication in combination with various degrees of counseling support to elligible smokers- 13 with Nicotine Replacement Therapy (NRT), & 2 with prescription medications (bupropion & varenicline)."),
DT::dataTableOutput("Table1"))
))
)
library(shiny)
library(shinydashboard)
library(RCurl) #package for the get URL function
library(foreign)
library(httr) # to embed HTML documents in Shiny
#HTML: Objective
Objective.html<- content(request, as="text")
#Table: Treatment Models of STOP
#Renaming column
names(Treatment_Models)[1]<- "Study Arm"
names(Treatment_Models)[2]<- "Provider Type"
names(Treatment_Models)[3]<- "Treatment Intervention"
shinyServer(function(input, output) {
#OBJECTIVE HTML
output$includeHTML <- renderText({Objective.html})
#TREATMENT MODELS TABLE
output$Table1 <- DT::renderDataTable({
DT::datatable(options = list(paging = FALSE, searching= TRUE,
autoWidth = TRUE, ordering=FALSE,
columnDefs = list(list(width = '800px', targets = "_all"))),
Treatment_Models[,]
)
})
})