title: R Shiny renderDT is returning a blank table
body: <p>I am creating another shiny app that allows the user to upload a <code>CSV</code> file and then display the data as table. The app works just fine however the table is blank even though it is picking up the column names.</p>
  <p>How can I fix this?</p>
  <p>Sample Data:</p>
  <pre><code>structure(list(Reference.Number = c(&quot;33333&quot;, &quot;44444&quot;, &quot;22222&quot;, 
  &quot;55555&quot;, &quot;66666&quot;), Request.Date = c(&quot;1/6/2022&quot;, &quot;1/6/2022&quot;, &quot;1/19/2022&quot;, 
  &quot;1/20/2021&quot;, &quot;1/24/2022&quot;), Requestor.Name = c(&quot;Comm Dist 3 by Kitty&quot;, 
  &quot;Comm Dist 3 by Kitty&quot;, &quot;Updated maps for David&quot;, 
  &quot;    Stone Cold&quot;, &quot;Updated SOE 60 inch wall map&quot;), Requestor.Dept.Div = c(&quot;C 3 Staff&quot;, 
  &quot;C 3 Staff&quot;, &quot;Unincorp &amp; Comm&quot;, &quot;Mt.Rushmore AME Church Ft. Billy&quot;, 
  &quot;SOE&quot;), Requestor.Phone = c(&quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;), Contact.Person = c(&quot;Tommy&quot;, 
  &quot;Tommy&quot;, &quot;Bob&quot;, &quot;Bob&quot;, &quot;Joe&quot;), Contact.Phone = c(&quot;1111&quot;, 
  &quot;2222&quot;, &quot;3333&quot;, &quot;ext 1111&quot;, &quot;3434&quot;), Deadline = c(&quot;1/20/2022&quot;, 
  &quot;1/20/2022&quot;, &quot;1/22/2022&quot;, &quot;&quot;, &quot;1/24/2022&quot;), Project.Description = c(&quot;45x36 portrait map &quot;, 
  &quot;45x36 portrait map  &quot;, 
  &quot;24x24 Unincorporated areas, &quot;Percent Females Aged 25 - 55  Below Poverty Level By Zip Code&quot;, 
  &quot;SOE Wall Map 60x60 p), Project.File.Location = c(&quot;&quot;, 
  &quot;&quot;, &quot;C:\\ABC\\Tommy\\work|Map-Projects\\BD Unincororated\\#14785 Unincorporated 24x24.pdf&quot;, 
  &quot;C:\\ABC\\Demographics\\Demographic_Request\\FemalesAge10-18BelowPoveryLevel\\FemalesAge10-18BelowPoveryLevel.aprx&quot;, 
  &quot;C:\\ABC\\Tommy\\work|Map-Projects\\BD Unincororated\\#14786 V P 60x60.pdf&quot;
  ), PDF.File.....Map.Name.... = c(&quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;C:\\ABC\\Demographics\\Demographic_Request\\FemalesAge10-18BelowPoveryLevel\\pdfs\\MapNo14785.pdf&quot;, 
  &quot;&quot;), Assigned.To = c(&quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;), Completion.Date = c(&quot;&quot;, 
  &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;), Notes = c(NA, NA, NA, NA, NA), Year = c(2022, 
  2022, 2022, 2022, 2022)), class = &quot;data.frame&quot;, row.names = c(NA, -5L)) 
  </code></pre>
  <p>Current Output:</p>
  <p><a href="https://i.stack.imgur.com/gp62e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gp62e.png" alt="enter image description here" /></a></p>
  <p>Code:</p>
  <pre><code>library(shiny)
  library(shinythemes)
  library(DT)
  library(tidyverse)
  
  # Define UI for application that draws a histogram
  ui =   navbarPage(title = div(&quot;Table&quot;),
                    theme = shinytheme(&quot;cyborg&quot;),
                    tabPanel(&quot;Projects&quot;,
                             icon = icon(&quot;info&quot;),
                             div(p(h1(&quot;Instructions:&quot;),style=&quot;text-align: justify;&quot;)),
                             p(&quot;1. The user can upload a CSV file.&quot;, style=&quot;color:white&quot;),
                             p(&quot;2. Based on the uploaded file, the app will return an interactive table that is searchable.&quot;, style=&quot;color:white&quot;),
                             p(&quot;3. Based on the uploaded file, the app will allow the user to add their project details in new rows or delete existing ones.&quot;, style=&quot;color:white&quot;),
                             uiOutput(&quot;all&quot;),
                    sidebarLayout(
                      sidebarPanel(
                        radioButtons(
                          &quot;File_Type&quot;,
                          label = &quot;Choose File type&quot;,
                          choices = list(&quot;.csv/txt&quot; = 1, &quot;.xlsx&quot; = 2),
                          selected = 1,
                          inline = TRUE
                        ),
                        
                        fileInput('file2', 'Upload Your Data',
                                  accept = c(
                                    'text/csv',
                                    'text/comma-separated-values,text/plain',
                                    '.csv',
                                    '.xlsx'
                                  ))),
                      mainPanel(
                        downloadButton(&quot;download1&quot;,&quot;Download data as csv&quot;),                
                        DTOutput(&quot;contents&quot;)),)
                      )
  )
  
  # Define server logic required to draw a histogram
  server &lt;- function(input, output) {
  
    myData = reactive({
      req(input$file2)
      inFile = input$file2
      if (is.null(inFile)) return(NULL)
      data = read.csv(inFile$datapath, header = TRUE)
      data
    })
    
    output$contents = renderDT({
      
      req(myData())
      myData()  
      
    })
    
  }
  
  # Run the application 
  shinyApp(ui = ui, server = server)
  </code></pre>