mainPanel unable work in Shiny Dashboard
<p>Question 1 : I tried to apply <strong>shinyDashboard</strong> package but there has no datatable display...</p>

<p><a href="https://i.stack.imgur.com/2JvDh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2JvDh.png" alt="ShinyDashboard UI"></a>
<a href="https://i.stack.imgur.com/2CcIw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2CcIw.png" alt="ShinyDashdoard Server"></a></p>

<pre><code>## Creating a parallel computing Cluster and support functions.
## Preparing the parallel cluster using the cores
doParallel::registerDoParallel(cores = 16)
pkgs &lt;- c('shiny','shinydashboard','magrittr','plyr','dplyr','googleVis','quantmod','TTR','lubridate','DT','purrr')
suppressMessages(require('BBmisc'))
suppressMessages(lib(pkgs)); rm(pkgs)

## Set the googleVis options first to change the behaviour of plot.gvis, so that only the chart 
##  component of the HTML file is written into the output file.
op &lt;- options(gvis.plot.tag='chart')

tickers &lt;- sort(c('BET', 'BOTB', 'BPTY', 'WMH', 'SPO', '888', 'NPT', 'PTEC', 'PCGE', 'TTR', 'GVC', 'WEB', 
                  'BOX', 'RNK', 'LAD', 'STR', 'LVS', 'TNI', 'WYNN', 'MGM', 'MPEL', 'MCRI', 'GXYEY', 'BYD', 
                  'GIGNY', 'CACQ', 'PENN', 'GEBHY', 'WYNMF', 'CWLDY', 'SCHYF', 'SKYZF', 'MCHVY', 'EGT', 
                  'GPIC', 'SGMS', 'NGCRF', 'TACBY', 'IGT', 'GDEN', 'ISLE', 'GLXZ', 'SJMHF', 'PDSSF', 'PNK'))

ui &lt;- dashboardPage(
    dashboardHeader(title = "Dynamic sidebar"),
    dashboardSidebar(),
    dashboardBody(
        fluidPage(
            titlePanel('Stock Price'),
            sidebarLayout(
                sidebarPanel(
                    helpText('Select the stocks to examine. Information will be collected from Google/Yahoo finance.'),
                    checkboxGroupInput('counter', 'Select counter(s)', choices = tickers), 
                    actionLink('selectall', 'Select/Unselect All'),
                    br(),
                    br(),
                    dateRangeInput('dates', 'Date range', start = '2013-01-01', end = as.character(Sys.Date())),
                    checkboxInput('log', 'Plot y axis on log scale', value = FALSE),
                    checkboxInput('adjust', 'Adjust prices for inflation', value = FALSE)),
                mainPanel(
                    tabsetPanel( #tabBox
                        tabPanel('Table', dataTableOutput('table1'), 
                                 downloadButton('downloadData', 'Download')),
                        tabPanel('Chart', htmlOutput('gvis')))
                )))
    )
)

server &lt;- function(input, output, session) {
    observe({
        if(input$selectall == 0) return(NULL)
        else if(input$selectall%%2 == 0){
            updateCheckboxGroupInput(session, 'counter', 'Select counter(s)', choices = tickers)
        }else{
            updateCheckboxGroupInput(session, 'counter', 'Select counter(s)', choices = tickers, selected = tickers)
        }
    })

    getCounter &lt;- function(){
        tickers &lt;- c('BET', 'BOTB', 'BPTY', 'WMH', 'SPO', '888', 'NPT', 'PTEC', 'PCGE', 'TTR', 'GVC', 'WEB', 
                 'BOX', 'RNK', 'LAD', 'STR', 'LVS', 'TNI', 'WYNN', 'MGM', 'MPEL', 'MCRI', 'GXYEY', 'BYD', 
                 'GIGNY', 'CACQ', 'PENN', 'GEBHY', 'WYNMF', 'CWLDY', 'SCHYF', 'SKYZF', 'MCHVY', 'EGT', 
                 'GPIC', 'SGMS', 'NGCRF', 'TACBY', 'IGT', 'GDEN', 'ISLE', 'GLXZ', 'SJMHF', 'PDSSF', 'PNK') %&gt;% sort
        data &lt;- llply(tickers, function(x) {
            y = data.frame(Com=x, as.data.frame(
                tryCatch(suppressAll(getSymbols(x, src = 'google', auto.assign = FALSE)), error = function(e) 
                    data.frame(Open=NA, High=NA, Low=NA, Close=NA, Volume=NA)))); 
            if(nrow(na.omit(y))==0) {
                y = data.frame(Com=x, as.data.frame(
                    tryCatch(suppressAll(getSymbols(x, src = 'yahoo', auto.assign = FALSE)), 
                             error = function(e) data.frame(Open=NA, High=NA, Low=NA, Close=NA, Volume=NA))))
            }else{
                y %&lt;&gt;% mutate(Date=as.character(rownames(.)), Weekday=factor(weekdays(ymd(Date))));
                names(y) &lt;- c('Com', 'Open', 'High', 'Low', 'Close', 'Volume', 'Date', 'Weekday')}; 
            y}, .parallel=TRUE) %&gt;% rbind_all %&gt;% tbl_df %&gt;% 
            select(Date, Weekday, Com, Open, High, Low, Close, Volume) %&gt;% mutate(Com=factor(Com))
        return(data)
    }

    output$table1 &lt;- renderDataTable({
        data &lt;- getCounter()
        df &lt;- as.data.frame(subset(data, Com %in% input$counter &amp; Date&gt;=input$dates[1] &amp; Date&lt;=input$dates[2]));
        dt &lt;- datatable(df, 
                        caption="Table 1.1.1 : Public Listed Companies Stock Price",
                        extensions = list("ColReorder"=NULL, "ColVis"=NULL, "TableTools"=NULL
                                          #, "FixedColumns"=list(leftColumns=2)
                        ), 
                        options = list(autoWidth=TRUE,
                                       oColReorder=list(realtime=TRUE), #oColVis=list(exclude=c(0, 1), activate='mouseover'),
                                       oTableTools=list(
                                           sSwfPath="//cdnjs.cloudflare.com/ajax/libs/datatables-tabletools/2.1.5/swf/copy_csv_xls.swf",
                                           aButtons=list("copy", "print",
                                                         list(sExtends="collection", sButtonText="Save",
                                                              aButtons=c("csv","xls")))),
                                       dom='CRTrilftp', scrollX=TRUE, scrollCollapse=TRUE,
                                       colVis=list(exclude=c(0), activate='mouseover')))
        return(dt)
    })

    output$gvis &lt;- renderGvis({
        data &lt;- getCounter()
        smp &lt;- subset(data, Com %in% input$counter &amp;
                          Date&gt;=input$dates[1] &amp; Date&lt;=input$dates[2])
        if(input$adjust) smp &lt;- adjust(subset(data, Com %in% input$counter &amp;
                                                  Date&gt;=input$dates[1] &amp; Date&lt;=input$dates[2]))
        if(input$log) smp &lt;- mutate(subset(data, Com %in% input$counter, 
                                           Date&gt;=input$dates[1] &amp; Date&lt;=input$dates[2]), 
                                    Low=log(Low), Open=log(Open), Close=log(Close), High=log(High))
        gvisCandlestickChart(smp, xvar='Date', low='Low', open='Open', close='Close', high='High', 
                             options=list(legend='none', gvis.editor="Edit me!"))
    })
}

runApp(shinyApp(ui, server), display.mode='showcase')
</code></pre>

<p>Above codes is not workable (Notes: the <strong>selectall</strong> function SUDDENLY unworkable without edit anything). While it is workable on normal Shiny with mainPanel without shinydashboard... Somebody shade me a light?</p>

<pre><code># server.R

suppressMessages(library('BBmisc'))
pkgs &lt;- c('shiny', 'shinythemes', 'shinyjs', 'shinyBS', 'shinydashboard', 'shinyAce', 'quantmod', 
          'TTR', 'plyr', 'dplyr', 'magrittr', 'stringr', 'purrr', 'googleCharts', 'lubridate', 
          'googleVis', 'DT', 'sparkline', 'zoo')
suppressMessages(lib(pkgs))
rm(pkgs)

tickers &lt;- c('BET', 'BOTB', 'BPTY', 'WMH', 'SPO', '888', 'NPT', 'PTEC', 'PCGE', 'TTR', 'GVC', 'WEB', 
             'BOX', 'RNK', 'LAD', 'STR', 'LVS', 'TNI', 'WYNN', 'MGM', 'MPEL', 'MCRI', 'GXYEY', 'BYD', 
             'GIGNY', 'CACQ', 'PENN', 'GEBHY', 'WYNMF', 'CWLDY', 'SCHYF', 'SKYZF', 'MCHVY', 'EGT', 
             'GPIC', 'SGMS', 'NGCRF', 'TACBY', 'IGT', 'GDEN', 'ISLE', 'GLXZ', 'SJMHF', 'PDSSF', 'PNK') %&gt;% sort

data &lt;- llply(tickers, function(x) {
  y = data.frame(Com=x, as.data.frame(
    tryCatch(suppressAll(getSymbols(x, src = 'google', auto.assign = FALSE)), error = function(e) 
      data.frame(Open=NA, High=NA, Low=NA, Close=NA, Volume=NA)))); 
  if(nrow(na.omit(y))==0) {
    y = data.frame(Com=x, as.data.frame(
      tryCatch(suppressAll(getSymbols(x, src = 'yahoo', auto.assign = FALSE)), 
               error = function(e) data.frame(Open=NA, High=NA, Low=NA, Close=NA, Volume=NA))))
  }else{
    y %&lt;&gt;% mutate(Date=as.character(rownames(.)), Weekday=factor(weekdays(ymd(Date))));
    names(y) &lt;- c('Com', 'Open', 'High', 'Low', 'Close', 'Volume', 'Date', 'Weekday')}; 
  y}, .parallel=TRUE) %&gt;% rbind_all %&gt;% tbl_df %&gt;% 
  select(Date, Weekday, Com, Open, High, Low, Close, Volume) %&gt;% mutate(Com=factor(Com))

#'@ googleChartsInit(chartTypes = c("ALL", "annotatedtimeline", "area", "bar", "bubble", "calendar", "candlestick", 
#'  "column", "combo", "gauge", "geo", "geomap", "intensitymap", "line", "map", "motion", "org", "pie", "sankey", 
#'  "scatter", "steppedarea", "table", "timeline", "treemap"))
## =================================================================================================

#'@ shiny::runApp(list(
  ui = pageWithSidebar(
    headerPanel("Example"),
    sidebarPanel(
      helpText('Select the stocks to examine. Information will be collected from Google/Yahoo finance.'),
      checkboxGroupInput('counter', 'Select counter(s)', choices = tickers), 
      actionLink('selectall', 'Select/Unselect All'),
      br(),
      br(),
      dateRangeInput('dates', 'Date range', start = '2013-01-01', end = as.character(Sys.Date())),
      br(),
      checkboxInput('log', 'Plot y axis on log scale', value = FALSE),
      checkboxInput('adjust', 'Adjust prices for inflation', value = FALSE)),
    mainPanel(
      tabsetPanel(
        tabPanel('Data', dataTableOutput('table1'),
                 downloadButton('downloadData', 'Download')),
        tabPanel('Plot', htmlOutput('gvis')))
    ))#'@ ,

  server = function(input, output, session) {
    observe({
      if(input$selectall == 0) return(NULL)
      else if(input$selectall%%2 == 0){
        updateCheckboxGroupInput(session, 'counter', 'Select counter(s)', choices = tickers)
      }else{
        updateCheckboxGroupInput(session, 'counter', 'Select counter(s)', choices = tickers, selected = tickers)
      }
    })

    output$table1 &lt;- renderDataTable({
      datatable(subset(data, Com %in% input$counter &amp; Date&gt;=input$dates[1] &amp; Date&lt;=input$dates[2]),
        caption="Table 1.1.1 : Public Listed Companies Stock Price",
        extensions = list("ColReorder"=NULL, "ColVis"=NULL, "TableTools"=NULL
                          #, "FixedColumns"=list(leftColumns=2)
                          ), 
        options = list(autoWidth=TRUE, 
                       oColReorder=list(realtime=TRUE), #oColVis=list(exclude=c(0, 1), activate='mouseover'),
                       oTableTools=list(
                         sSwfPath="//cdnjs.cloudflare.com/ajax/libs/datatables-tabletools/2.1.5/swf/copy_csv_xls.swf",
                         aButtons=list("copy", "print",
                                       list(sExtends="collection", sButtonText="Save",
                                            aButtons=c("csv","xls")))),
                       dom='CRTrilftp', scrollX=TRUE, scrollCollapse=TRUE,
                       colVis=list(exclude=c(0), activate='mouseover')))
    })

    output$gvis &lt;- renderGvis({
      smp &lt;- subset(data, Com %in% input$counter &amp;
                      Date&gt;=input$dates[1] &amp; Date&lt;=input$dates[2])
      if(input$adjust) smp &lt;- adjust(subset(data, Com %in% input$counter &amp;
                                            Date&gt;=input$dates[1] &amp; Date&lt;=input$dates[2]))
      if(input$log) smp &lt;- mutate(subset(data, Com %in% input$counter, 
                                         Date&gt;=input$dates[1] &amp; Date&lt;=input$dates[2]), 
                                  Low=log(Low), Open=log(Open), Close=log(Close), High=log(High))
      gvisCandlestickChart(smp, xvar='Date', low='Low', open='Open', close='Close', high='High', 
                           options=list(legend='none', gvis.editor="Edit me!"))
    })
  }
#'@ ))

# Run the application 
shinyApp(ui = ui, server = server)
</code></pre>

<p><a href="https://i.stack.imgur.com/VA8Un.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VA8Un.png" alt="Shiny apps"></a></p>

<p>Question 2 : By the way, there has another error on piper function when I posted to rstudioconnect and shinyapps deployment website. I tried to not use piper function but the rstudioconnect keep showing <strong>No function %>% found.</strong> message.</p>

<p><a href="https://i.stack.imgur.com/b9b1t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b9b1t.png" alt="Piper Error"></a></p>