title: R shiny different output between renderTable and renderDataTable
body: <p>I have a shiny application that shows a nice html table of my data, using <code>renderDataTable</code>. Then I wanted to make some basic statistics, subset data and calculate means and some other data. </p>
  
  <p>When showing results with <code>renderTable</code>, I found that date column was not shown in date format. In the figure ou can see the difference. Both tables are generated from the same dataset in the same shiny web app. Can you explain what's happening?</p>
  
  <p><img src="https://i.stack.imgur.com/5KeN9.png" alt="enter image description here"></p>
  
  <p>And here you can see ui.R and server.R. In this script I just want to show a table and was surprised by the different output.</p>
  
  <p><strong>ui.R</strong></p>
  
  <pre><code>library(shiny)
  
  # Estructura de la página (paneles)
  shinyUI(pageWithSidebar(
    # Título superior
    headerPanel(""),
    # Panel lateral izquierdo - selección de datos
    sidebarPanel(
      helpText("Selecciona las fechas y el tipo de datos.
               Pulsa el botón Actualizar."),    
      selectInput("torre", "Torre:",
                  list("Agres" = "mariola",
                       "Alfàs del Pi" = "shelada",
                       "Altura" = "altura",                                          
                       "Vistabella del Maestrat" = "vistabella",
                       "Xàtiva" = "xativa")),       
      selectInput("tipo", "Intervalo de datos",
                  list("Diezminutales" = "-datos-10m.csv",
                       "Diarios" = "-datos-diarios.csv",
                       "Mensuales" = "-datos-mensuales.csv")),
      dateInput('date1',
                label = 'Fecha inicial',
                value = Sys.Date()),
      dateInput('date2',
                label = 'Fecha final.',
                value = Sys.Date()),
      submitButton("Actualizar"),
      helpText("
               Descarga de datos tabulados en formato CSV."),
      downloadButton('downloadData','Descargar datos')    
    ),
  
    # Panel principal (presentación de gráficas)
    mainPanel(
      tabsetPanel(
        tabPanel("Inicio",
                 h3("Consulta de datos"),
                 p(HTML("Some info.")),
                 tableOutput("view")
                 ),
        tabPanel("Ayuda", htmlOutput("ayuda"),id="ayuda"),
        tabPanel('Tabla de datos', dataTableOutput("table1")),      
        tabPanel('Medias', tableOutput("table2"))
      )
    )
  ))
  </code></pre>
  
  <p>and <strong>server.R</strong></p>
  
  <pre><code>library(shiny)
  library(plyr)
  library(lubridate)
  library(scales)
  
  options(shiny.transcode.json = FALSE)
  
  # Funciones
  shinyServer(function(input,output){
  
    filename=reactive({
      paste0(input$torre,input$tipo)
      })
    day1=reactive({
      as.POSIXct(input$date1)
    })
    day2=reactive({
      as.POSIXct(input$date2)    
    })
  
    # Ayuda
    introFile &lt;- './ayuda.txt'
    ayuda &lt;- readChar(introFile, file.info(introFile)$size)
    output$ayuda &lt;- renderText({HTML(ayuda)})
  
    datos2=reactive({
      fn = filename()
      f = read.csv(fn,header=T, sep=",",na.strings="-99.9")
      f$date = as.Date(f$date)
      f
    })
    datos=reactive({
      d1 &lt;- as.Date(day1())
      d2 &lt;- as.Date(day2())
      datos2a = datos2()
      with( datos2a , datos2a[ date &gt;= d1 &amp; date &lt;= d2, ] )
    })  
  
    #  Tabla de datos
    output$table1 = renderDataTable({
      datos()
    }, options = list(aLengthMenu = c(12, 20, 40), iDisplayLength = 12))
  
    output$table2 = renderTable({
      datos()
    })
  
    output$downloadData &lt;- downloadHandler(
      file = c('data.csv'),
      content = function(file) {
        write.csv(datos(), file)
      }
    )
  
  })
  </code></pre>
  
  <p>Thanks in advance for your help</p>