readxl input not displaying as DT in shiny

Hello,

This may be a basic question but a newb that I am I can't figure it out. I am trying to import an excel file and display a tiblle of the imported data. Unfortunately renderDataTable doesn't seem to work. No errors or warning - simply not displaying at all. the kicker is that I am trying some other inputs as per the code below and it works out great. Can't figure this one out - any help will be greatly appreciated. thank you

Server:

shinyServer(function(input, output) {
    
    base<-reactive({data_frame(
        details = c("Sponsor","Authorized Representative", "Product Sample ID", "Study Number", 
                    "Testing Site", "Testing Start Date", "Testing Completion Date", "Technical Specification",
                    "Technical Specification Amendment", "PSQ/Qualification", "Amount of Sample Tested",
                    "Non Conformances")
       
                        )
                            })
    
    base_values <- reactive({data_frame(
        values = list(input$sponsor, input$representative, input$sample, input$sample, input$site,
                   input$start_date, input$end_date, paste(input$ts, input$ts_ver, sep="."),
                   input$ts_amen, input$psq, 
                   paste(input$sample_amount, ifelse(input$vol_unit==paste("\u03BC", "L", sep=""), paste("\u03BC", "L", sep=""), "mL"), sep=""),
                    input$non_confromances)
                        )
                            })
    
    map_metrics <- reactive({
                            inFile <- input$results
                            if(is.null(inFile))
                            return(NULL)
                            
                    map_metrics <- read_excel(paste(inFile$datapath),
                                    sheet = "vc_analysis", skip = 2, n_max = 2, col_names = FALSE)
                            })
   
    
    
    
    
     output$base<-DT::renderDataTable({
         base_values() #This piece displays beautifully
         })
     
     output$map_metrics <- DT::renderDataTable({
         map_metrics() #This piece doesn't display at all
        })
    
         
    })

```r

part of theUI with file input code:

```r
 titlePanel(
        h1("ID by NGS CoA", align = "center")
                                                            ),

    # Sidebar with a slider input for number of bins
    sidebarLayout(
        sidebarPanel(
            fileInput(inputId = "results", label = "VCA results")
```r

Hi,

I figured it out. I am an idiot. I forgot to add the table into the ui:

Server:


 output$map_metrics<-DT::renderDataTable({
        map_metrics() #This piece doesn't display at all
            })
```r    

UI:

```r    
 mainPanel(
            DT::dataTableOutput("base"),
            DT::dataTableOutput("map_metrics")

```r    

This did the trick. 

D

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.