I am creating a simple shiny app with some valuebox and three datatables.
If I design the app without using tabpanel everything works fine.
library(shiny)
library(shinydashboard)
library(DT)
ui <- dashboardPage(
dashboardHeader(title = "Dynamic boxes"),
dashboardSidebar(),
dashboardBody(
fluidRow(
valueBoxOutput("vbox1", width = 2),
valueBoxOutput("vbox2", width = 2),
valueBoxOutput("vbox3", width = 2),
valueBoxOutput("vbox4", width = 2),
valueBoxOutput("vbox5", width = 2),
valueBoxOutput("vbox6", width = 2)
),
fluidRow(
column(width = 4, box(title = "Iris", width = NULL, solidHeader = FALSE, dataTableOutput("dat1"))),
column(width = 4, box(title = "MT Cars", width = NULL, solidHeader = FALSE, dataTableOutput("dat2"))),
column(width = 4, box(title = "Old Faithful Gyser", width = NULL, solidHeader = FALSE, dataTableOutput("dat3")))
))
)
server <- function(input, output) {
output$vbox1 <- renderValueBox({ valueBox( "One","Yes",icon = icon("stethoscope"))})
output$vbox2 <- renderValueBox({ valueBox( "Two","Yes",icon = icon("stethoscope"))})
output$vbox3 <- renderValueBox({ valueBox( "Skip","Yes",icon = icon("stethoscope"))})
output$vbox4 <- renderValueBox({ valueBox( "a Two","Yes",icon = icon("stethoscope"))})
output$vbox5 <- renderValueBox({ valueBox( "Then","Yes",icon = icon("stethoscope"))})
output$vbox6 <- renderValueBox({ valueBox( "some","Yes",icon = icon("stethoscope"))})
output$dat1 <- renderDataTable({datatable(iris)})
output$dat2 <- renderDataTable({datatable(mtcars,extensions = 'Responsive' )})
output$dat3 <- renderDataTable({datatable(faithful,rownames = FALSE, options = list(autoWidth = TRUE) )})
}
shinyApp(ui, server)
Now if I design the app using tabpanel function there is a lot of wasted white space on the rightside.
library(shiny)
library(shinydashboard)
library(shinyBS)
library(DT)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(
sidebarPanel(
textInput("text", "Enter Id:"),
box(width = 1, background = 'purple'),
actionButton("Ok", "Press Ok",style='padding:8px; font-size:100%')
)
),
dashboardBody(
mainPanel(
tabsetPanel(
tabPanel("About", value=1, h6("The objective is to test width of ShinyApp in tabPanel design", br(),
br(),
"Distribution Prototype"
)
),
tabPanel("Data", value=2,
fluidRow(
valueBoxOutput("vbox1", width = 2),
valueBoxOutput("vbox2", width = 2),
valueBoxOutput("vbox3", width = 2),
valueBoxOutput("vbox4", width = 2),
valueBoxOutput("vbox5", width = 2),
valueBoxOutput("vbox6", width = 2)
),
fluidRow(
column(width = 4, box(title = "Iris", width = NULL, solidHeader = FALSE, dataTableOutput("dat1"))),
column(width = 4, box(title = "MT Cars", width = NULL, solidHeader = FALSE, dataTableOutput("dat2"))),
column(width = 4, box(title = "Old Faithful Gyser", width = NULL, solidHeader = FALSE, dataTableOutput("dat3"))))
)
)
)
))
server <- function(input, output) {
output$vbox1 <- renderValueBox({ valueBox( "One","Yes",icon = icon("stethoscope"))})
output$vbox2 <- renderValueBox({ valueBox( "Two","Yes",icon = icon("stethoscope"))})
output$vbox3 <- renderValueBox({ valueBox( "Skip","Yes",icon = icon("stethoscope"))})
output$vbox4 <- renderValueBox({ valueBox( "a Two","Yes",icon = icon("stethoscope"))})
output$vbox5 <- renderValueBox({ valueBox( "Then","Yes",icon = icon("stethoscope"))})
output$vbox6 <- renderValueBox({ valueBox( "some","Yes",icon = icon("stethoscope"))})
output$dat1 <- renderDataTable({datatable(iris)})
output$dat2 <- renderDataTable({datatable(mtcars,extensions = 'Responsive' )})
output$dat3 <- renderDataTable({datatable(faithful,rownames = FALSE, options = list(autoWidth = TRUE) )})
}
shinyApp(ui, server)
Wasted White Space Image
My usecase dictates that I use tabpanel, so any suggestions on making these objects span across the entire layout without wasting space is much appreciated.
Related
I have a shiny application in which I have tabs.
In these tabs I want to put some boxes like this : https://rstudio.github.io/shinydashboard/structure.html#valuebox
The display seems to be buggy and doesn't show the box outlines or even the colours at all
ui <- fluidPage(mainPanel(tabsetPanel(
id = 'tabset',
tabPanel(title = "First tab",
fluidRow(
box(
title = "First box",
width = 6,
solidHeader = TRUE,
status = "primary",
valueBoxOutput("progressBox1")
),
box(
title = "Second box",
width = 6,
solidHeader = TRUE,
status = "primary",
valueBoxOutput("progressBox2")
)
)),
tabPanel(title = "Second tab",
fluidRow(
box(
title = "Third box",
width = 6,
solidHeader = TRUE,
status = "primary",
valueBoxOutput("progressBox3")
)
)),
)))
)
server <- function(input, output, session) {
output$progressBox1 <- renderValueBox({
valueBox(
"80%", "Approval", icon = icon("thumbs-up", lib = "glyphicon"),
color = "yellow"
)
})
output$progressBox2 <- renderValueBox({
valueBox(
"12%", "Approval", icon = icon("thumbs-up", lib = "glyphicon"),
color = "purple"
)
})
output$progressBox3 <- renderValueBox({
valueBox(
"80%", "Approval", icon = icon("list"),
color = "yellow"
)
})
}
if (interactive()) {
shinyApp(ui, server)
}
The boxes are displayed correctly in a shinydashboard application.
Is there a way to display boxes when you have tabs in a shiny app (not shinydashboard) ?
As the title says. I have entered the code exactly as it is the book, but I run into this error message: "Error in shiny::tabsetPanel(..., id=id, selected = selected) : argument is missing, with no default"
I have no idea what is missing.
Here is the code:
library(shinydashboard)
ui<- dashboardPage(
dashboardHeader(title= "Uniform Distribution"),
dashboardSidebar(),
dashboardBody(
fluidRow(
column(width =6,
box(title = "Select a Number",
solidHeader = TRUE,
background = "yellow",
status = "warning",
width = NULL,
height = 312,
sliderInput(inputId = "number",
label = "",
value = 500, min = 25, max = 1000)),
box(
background= "light-blue",
solidHeader = TRUE,
status ="primary",
title = "Histogram",
width = NULL,
plotOutput("hist", height = 250))),
column(width = 6,
tabBox(
title ="Central Tendency",
id ="tabs1", height = 120, width =NULL,
tabPanel("Mean", h2(textOutput("meantext")),width=NULL),
tabPanel("Median", h2(textOutput("mediantext")),width=NULL),
),
tabBox(
title ="Variability",
id ="tabs2", height = 120, width =NULL,
tabPanel("Variance", h2(textOutput("vartext")),width=NULL),
tabPanel("Standard Deviation", h2(textOutput("sdtext")),width=NULL))
)
)
))
server <- function(input,output){
histdata <- reactive({runif(input$number, min=0, max = 1)})
output$hist <- renderPlot({
hist(histdata(), xlab = "Value",
main= paste(input$number,"random values between 0 and 1"))
})
output$meantext <- renderText({
paste("Mean =", round(mean(histdata()),3))})
output$mediantext <- renderText({
paste("Median =", round(median(histdata()),3))})
output$vartext <- renderText({
paste("Variance =", round(var(histdata()),3))})
output$sdtext <- renderText({
paste("Standard Deviation =", round(sd(histdata()),3))})
}
shinyApp(ui, server)
You have tabPanels outside of tabsetPanels. Your tabPanels need to wrapped inside tabsetPanel() or navBarPage()
See below:
ui<- dashboardPage(
dashboardHeader(title= "Uniform Distribution"),
dashboardSidebar(),
dashboardBody(
fluidRow(
column(width =6,
box(title = "Select a Number",
solidHeader = TRUE,
background = "yellow",
status = "warning",
width = NULL,
height = 312,
sliderInput(inputId = "number",
label = "",
value = 500, min = 25, max = 1000)),
box(
background= "light-blue",
solidHeader = TRUE,
status ="primary",
title = "Histogram",
width = NULL,
plotOutput("hist", height = 250))),
column(width = 6,
tabBox(
title ="Central Tendency",
id ="tabs1", height = 120, width =NULL,
tabsetPanel(
tabPanel("Mean", h2(textOutput("meantext")),width=NULL),
tabPanel("Median", h2(textOutput("mediantext")),width=NULL)
)
),
tabBox(
title ="Variability",
id ="tabs2", height = 120, width =NULL,
tabsetPanel(
tabPanel("Variance", h2(textOutput("vartext")),width=NULL),
tabPanel("Standard Deviation", h2(textOutput("sdtext")),width=NULL)
)
)
)
)
))
Im using shiny dashboard for an app, but cant find a way to center the title:
box(title = "Labels"
, status = "primary", solidHeader = T...
The "Labels title is in the left corner, of the box and would like it to be in the center, any ideas?
Some options for you...
library(shiny)
library(shinydashboard)
ui <- shinyUI(dashboardPage(
dashboardHeader(title = "Test App"),
dashboardSidebar(
selectInput("dt","Data", choices = list("cars","mtcars","pressure") )
),
## BODY
dashboardBody(
fluidRow(
column(
width = 10,
box(title = h1("My Title with h1 ", align="center"),
solidHeader = T,
width = 5, height = 500,
collapsible = T,
plotOutput("plot1", height=350)
),
box(title = h6("My Title with h6 ", align="center"),
solidHeader = T,
width = 5, height = 500,
collapsible = T,
plotOutput("plot2")
))), br(), br(),
fluidRow(
column(width = 8, align="center",
box(title = div("My Title with div, red color and font-size 22 ", style='color:red; font-size:22px;'),
solidHeader = T,
width = 8, height = 500,
collapsible = T,
plotOutput("plot3")
) )
)
)))
server <- shinyServer(function(input, output) {
output$plot1 <- renderPlot({
req(input$dt)
plot(get(input$dt))
})
output$plot2 <- renderPlot({plot(mtcars)})
output$plot3 <- renderPlot({plot(pressure)})
})
shinyApp(ui = ui, server = server)
I am trying to create two tabs and for each tab in shiny I want to have different UI for each tab.
I am able to create two tabs and the problems i face is the UI is not specific for each tab and when I add the second tab, the UI in the first tab doesn't work. Any idea how to resolve these issues?
The code looks like this:
#Library
library(shiny)
library(shinydashboard)
#Run the Source
pdf(NULL)
#Shiny Header/Sidebar/Body
header=dashboardHeader(title = "FTA Risk Center")
sidebar=dashboardSidebar(sidebarMenu(id = "sidebarmenu",
menuItem("Risk Dashboard", tabName = "Flow", icon = icon("dashboard")),
menuItem("HKJAP", tabName = "HKJAP", icon = icon("th")),
menuItem("HKKOR", tabName = "HKKOR", icon = icon("th"))
))
body=dashboardBody(
tabItems(tabItem(tabName = "HKJAP",uiOutput('output1'),
fluidRow(column(width = 3,box(title = "Summary of EQ Delta", width = NULL, collapsible = TRUE, solidheader = TRUE,status = "primary",tableOutput("EOD"))),column(width = 3,box(title = "Summary of FX Delta", width = NULL, collapsible = TRUE, solidheader = TRUE,status = "primary",tableOutput("FX"))),column(width = 3,box(title = "Unmapped Tickers", width = NULL, collapsible = TRUE, solidheader = TRUE,status = "primary",tableOutput("UnmappedTickers")))),
fluidRow(column(width = 8,box(title = "Exposures by Indices", width = NULL, collapsible = TRUE, solidheader = TRUE,status = "primary",plotOutput("Chart1"))))),
tabItem(tabName = "HKKOR",uiOutput('output2'),
fluidRow(column(width = 3,box(title = "Summary of EQ Delta", width = NULL, collapsible = TRUE, solidheader = TRUE,status = "primary",tableOutput("EOD"))),column(width = 3,box(title = "Summary of FX Delta", width = NULL, collapsible = TRUE, solidheader = TRUE,status = "primary",tableOutput("FX"))),column(width = 3,box(title = "Unmapped Tickers", width = NULL, collapsible = TRUE, solidheader = TRUE,status = "primary",tableOutput("UnmappedTickers")))),
fluidRow(column(width = 8,box(title = "Exposures by Indices", width = NULL, collapsible = TRUE, solidheader = TRUE,status = "primary",plotOutput("Chart2")))))
)
)
ui <- dashboardPage(header,sidebar,body)
#Shiny Server
server <- function(input, output,session) {
observeEvent(input$sidebarmenu,{
if(input$sidebarmenu == "HKJAP")
{
obsJAP <- observeEvent(reactiveTimer(30000)(),{ # Trigger every 30 seconds
source("HKJAP_Live_monitor_v1.R")
obsJAP$destroy()
})
output$output1 <- renderUI({
invalidateLater(30000, session)
h1(paste("Risk Exposures as of ",Sys.time()))
})
output$EOD=renderTable({
invalidateLater(30000, session)
EQ_delta_summary_Live})
output$FX=renderTable({
invalidateLater(30000, session)
FX_delta_summary_Live})
output$UnmappedTickers=renderTable({
invalidateLater(30000, session)
unmapped_tickers})
output$Chart1=renderPlot({
invalidateLater(30000, session)
plot(NIKKEI$trade_time,cumsum(NIKKEI$EQ_Delta),type='l',xlim=time_scale,ylim=c(-30,30), main=paste("Main Indices"),lwd=2)
grid(10,10,lty=5)
lines(TOPIX$trade_time,cumsum(TOPIX$EQ_Delta),type='l',col="red",lwd=3)
lines(NIKKEI_400$trade_time,cumsum(NIKKEI_400$EQ_Delta),type='l',col="orange",lwd=3)
lines(MXJ$trade_time,cumsum(MXJ$EQ_Delta),type='l',col="green",lwd=3)
lines(TSE_MOTHERS$trade_time,cumsum(TSE_MOTHERS$EQ_Delta),type='l',col="blue",lwd=3)
lines(REITS$trade_time,cumsum(REITS$EQ_Delta),type='l',col="pink",lwd=3)
legend("topright",c("TOPIX","NIKKEI","NIKKEI 400","MXJ","TSE_M","REITS"),lty = c(1,1),col = c("red","black","orange","green","blue","pink"),,bty = 'n',cex = 0.8)
})
}else if(input$sidebarmenu == "HKKOR"){
obsKOR <- observeEvent(reactiveTimer(30000)(),{ # Trigger every 30 seconds
source("HKKOR_Live_monitor_v1.R")
obsKOR$destroy()
})
output$output2 <- renderUI({
invalidateLater(30000, session)
h1(paste("Risk Exposures as ",Sys.time()))
})
output$EOD=renderTable({
invalidateLater(30000, session)
EQ_delta_summary_Live})
output$FX=renderTable({
invalidateLater(30000, session)
FX_delta_summary_Live})
output$UnmappedTickers=renderTable({
invalidateLater(30000, session)
unmapped_tickers})
output$Chart2=renderPlot({
invalidateLater(30000, session)
plot(KOSPI_DIV$trade_time,cumsum(KOSPI_DIV$EQ_Delta),type='l',xlim=time_scale,ylim=c(-30,30), main=paste("Main Indices"),lwd=2)
grid(10,10,lty=5)
lines(KOSPI$trade_time,cumsum(KOSPI$EQ_Delta),type='l',col="red",lwd=3)
lines(KOSDAQ$trade_time,cumsum(KOSDAQ$EQ_Delta),type='l',col="orange",lwd=3)
lines(KRX$trade_time,cumsum(KRX$EQ_Delta),type='l',col="green",lwd=3)
lines(MSCI_KOR$trade_time,cumsum(MSCI_KOR$EQ_Delta),type='l',col="blue",lwd=3)
lines(SPX_HKKOR$trade_time,cumsum(SPX_HKKOR$EQ_Delta),type='l',col="pink",lwd=3)
legend("topright",c("KOSPI_DIV","KOSPI","KOSDAQ","KRX","MSCI_KOR","SPX"),lty = c(1,1),col = c("black","red","orange","green","blue","pink"),,bty = 'n',cex = 0.8)
})
}
}
)
}
shinyApp(ui, server)
This is an extension of my previous question. Now I am not able to extend the height of my main panel.
This is my code below
library(shiny)
library(shinydashboard)
library(shinyBS)
library(DT)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(
sidebarPanel(
textInput("text", "Enter Id:"),
box(width = 1, background = 'purple'),
actionButton("Ok", "Press Ok",style='padding:8px; font-size:100%')
)
),
dashboardBody(
mainPanel(width = 12,
tabsetPanel(
tabPanel("About", value=1, h6("The objective is to test width of ShinyApp in tabPanel design", br(),
br(),
"Distribution Prototype"
)
),
tabPanel("Data", value=2,
fluidRow(
valueBoxOutput("vbox1", width = 2),
valueBoxOutput("vbox2", width = 2),
valueBoxOutput("vbox3", width = 2),
valueBoxOutput("vbox4", width = 2),
valueBoxOutput("vbox5", width = 2),
valueBoxOutput("vbox6", width = 2)
),
fluidRow(
column(width = 4, box(title = "Iris", width = NULL, solidHeader = FALSE, dataTableOutput("dat1"))),
column(width = 4, box(title = "MT Cars", width = NULL, solidHeader = FALSE, dataTableOutput("dat2"))),
column(width = 4, box(title = "Old Faithful Gyser", width = NULL, solidHeader = FALSE, dataTableOutput("dat3")))),
fluidRow(
column(width = 4, box(title = "Plot1", width = NULL, solidHeader = FALSE, plotOutput("plot1", height = "600px"))),
column(width = 4, box(title = "Plot2", width = NULL, solidHeader = FALSE, plotOutput("plot2", height = "600px"))),
column(width = 4, box(title = "Plot3", width = NULL, solidHeader = FALSE, plotOutput("plot3", height = "600px")))
)
)
)
)
))
server <- function(input, output) {
output$vbox1 <- renderValueBox({ valueBox( "One","Yes",icon = icon("stethoscope"))})
output$vbox2 <- renderValueBox({ valueBox( "Two","Yes",icon = icon("stethoscope"))})
output$vbox3 <- renderValueBox({ valueBox( "Three","Yes",icon = icon("stethoscope"))})
output$vbox4 <- renderValueBox({ valueBox( "Four","Yes",icon = icon("stethoscope"))})
output$vbox5 <- renderValueBox({ valueBox( "Five","Yes",icon = icon("stethoscope"))})
output$vbox6 <- renderValueBox({ valueBox( "Six","Yes",icon = icon("stethoscope"))})
output$dat1 <- renderDataTable({datatable(iris)})
output$dat2 <- renderDataTable({datatable(mtcars,extensions = 'Responsive' )})
output$dat3 <- renderDataTable({datatable(faithful,rownames = FALSE, options = list(autoWidth = TRUE) )})
}
shinyApp(ui, server)
The plots are sticking out of the default layout space and I am not finding any options in the mainPanel() to increase the height. I attempted forcing the height value within the mainPanel(), like this mainPanel(width = 12, height, 20 ....) and that did not work. Any suggestion is much appreciated.
+
---------Updated-------------
Not sure if this helps, this is not an issue when I dont use mainpanel()
library(shiny)
library(shinydashboard)
library(DT)
ui <- dashboardPage(
dashboardHeader(title = "Dynamic boxes"),
dashboardSidebar(
conditionalPanel(condition="input.tabselected==3",
textInput("text", "Enter Id:"),
box(width = 1, background = 'purple'),
actionButton("Ok", "Press Ok",style='padding:8px; font-size:100%')
)
),
dashboardBody(
fluidRow(
valueBoxOutput("vbox1", width = 2),
valueBoxOutput("vbox2", width = 2),
valueBoxOutput("vbox3", width = 2),
valueBoxOutput("vbox4", width = 2),
valueBoxOutput("vbox5", width = 2),
valueBoxOutput("vbox6", width = 2)
),
fluidRow(
column(width = 4, box(title = "Iris", width = NULL, solidHeader = FALSE, dataTableOutput("dat1"))),
column(width = 4, box(title = "MT Cars", width = NULL, solidHeader = FALSE, dataTableOutput("dat2"))),
column(width = 4, box(title = "Old Faithful Gyser", width = NULL, solidHeader = FALSE, dataTableOutput("dat3")))
),
fluidRow(
column(width = 4, box(title = "Plot1 ", width = NULL, solidHeader = FALSE, plotOutput("plot1", height = "600px"))),
column(width = 4, box(title = "Plot2", width = NULL, solidHeader = FALSE, plotOutput("plot2", height = "600px"))),
column(width = 4, box(title = "Plot3", width = NULL, solidHeader = FALSE, plotOutput("plot3", height = "600px")))
)
)
)
server <- function(input, output) {
output$vbox1 <- renderValueBox({ valueBox( "One","Yes",icon = icon("stethoscope"))})
output$vbox2 <- renderValueBox({ valueBox( "Two","Yes",icon = icon("stethoscope"))})
output$vbox3 <- renderValueBox({ valueBox( "Three","Yes",icon = icon("stethoscope"))})
output$vbox4 <- renderValueBox({ valueBox( "Four","Yes",icon = icon("stethoscope"))})
output$vbox5 <- renderValueBox({ valueBox( "Five","Yes",icon = icon("stethoscope"))})
output$vbox6 <- renderValueBox({ valueBox( "Six","Yes",icon = icon("stethoscope"))})
output$dat1 <- renderDataTable({datatable(iris)})
output$dat2 <- renderDataTable({datatable(mtcars,extensions = 'Responsive' )})
output$dat3 <- renderDataTable({datatable(faithful,rownames = FALSE, options = list(autoWidth = TRUE) )})
#output$dat4 <- renderDataTable({datatable(data.frame(HairEyeColor),extensions = 'Responsive' )})
}
shinyApp(ui, server)
You are not using the functions from shinydashboard but rather the standard shiny package and you need to wrap your tabBox inside a fluidRow.
library(shiny)
library(shinydashboard)
library(shinyBS)
library(DT)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(
sidebarPanel(
textInput("text", "Enter Id:"),
box(width = 1, background = 'purple'),
actionButton("Ok", "Press Ok",style='padding:8px; font-size:100%')
)
),
dashboardBody(
fluidRow(
tabBox(width = 12, height = NULL,
tabPanel("About", value=1, h6("The objective is to test width of ShinyApp in tabPanel design", br(),
br(),
"Distribution Prototype"
)
),
tabPanel("Data", value=2,
fluidRow(
valueBoxOutput("vbox1", width = 2),
valueBoxOutput("vbox2", width = 2),
valueBoxOutput("vbox3", width = 2),
valueBoxOutput("vbox4", width = 2),
valueBoxOutput("vbox5", width = 2),
valueBoxOutput("vbox6", width = 2)
),
fluidRow(
column(width = 4, box(title = "Iris", width = NULL, solidHeader = FALSE, dataTableOutput("dat1"))),
column(width = 4, box(title = "MT Cars", width = NULL, solidHeader = FALSE, dataTableOutput("dat2"))),
column(width = 4, box(title = "Old Faithful Gyser", width = NULL, solidHeader = FALSE, dataTableOutput("dat3")))),
fluidRow(
column(width = 4, box(title = "Plot1", width = NULL, solidHeader = FALSE, plotOutput("plot1"))),
column(width = 4, box(title = "Plot2", width = NULL, solidHeader = FALSE, plotOutput("plot2"))),
column(width = 4, box(title = "Plot3", width = NULL, solidHeader = FALSE, plotOutput("plot3")))
)
)
)
)
))
server <- function(input, output) {
output$vbox1 <- renderValueBox({ valueBox( "One","Yes",icon = icon("stethoscope"))})
output$vbox2 <- renderValueBox({ valueBox( "Two","Yes",icon = icon("stethoscope"))})
output$vbox3 <- renderValueBox({ valueBox( "Three","Yes",icon = icon("stethoscope"))})
output$vbox4 <- renderValueBox({ valueBox( "Four","Yes",icon = icon("stethoscope"))})
output$vbox5 <- renderValueBox({ valueBox( "Five","Yes",icon = icon("stethoscope"))})
output$vbox6 <- renderValueBox({ valueBox( "Six","Yes",icon = icon("stethoscope"))})
output$dat1 <- renderDataTable({datatable(iris)})
output$dat2 <- renderDataTable({datatable(mtcars,extensions = 'Responsive' )})
output$dat3 <- renderDataTable({datatable(faithful,rownames = FALSE, options = list(autoWidth = TRUE) )})
}
shinyApp(ui, server)