I am sending all the core:
library(shiny)
ui <- fluidPage(
tags$head(
tags$style(HTML("
@import url('//fonts.googleapis.com/css?family='Helvetica', 'Arial', sans-serif:400,700');
"))
),
fluidRow(
column(width = 3, offset = 1),
headerPanel(
h1("glycoPipe - Identification and Analysis Pipeline R Package",
style = "font-family: 'Lobster', 'cursive';
font-weight: 500; line-height: 1.1;
color: #394779;"))
),
sidebarLayout(
sidebarPanel(
fluidRow(
column(width = 3, offset = 0,
img(src="logo.jpeg", height = 50, width = 200, align = "middle"))
),
fluidRow(
column(width = 3, offset = 0,div(style = "height:25px;background-color: #99CCFF", strong("Urology"))
)
),
# "")
#fileInput("file", "upload the file"),
#h5("Max file size to upload is 5 MB")
fluidRow(
column(width = 10,
selectInput("value", label = h4("Do you have a parameter file ready to use, Y/N?"),
choices =c("", "Y" , "N"), selected = NULL))
),
conditionalPanel(
condition = "input.value == 'Y'",
helpText(h4("Select your params file")),
fluidRow(
column(width = 10,fileInput("file", "upload the file" ),
helpText("Default max file size 5 MB"),
tags$hr(),
h5(helpText("select the parameters below")),
checkboxInput(inputId = "Header","Header?", value = FALSE),
br(),
radioButtons(inputId = "sep", label = "separator", choices = c(Comma = ",", Semicolon = ";", Tab = "\t", Space = " "))
)
)
)
),
mainPanel(
#textOutput("value"),
uiOutput("tb")
#tableOutput("inputFile")
)
)
)
server <- function(input, output){
# output$value <- renderText({
# paste("You chose", input$value)
# })
data <- reactive({
output$inputFile <- renderTable({
fileToRead = input$inputFile
if(is.null(fileToRead)){
return()
}
read.table(fileToRead$datapath, sep = input$sep, header = input$header, stringsAsFactors = input$stringsAsfactors)
})
})
output$table <- renderDataTable({
if(is.null(data())){
return()
}
data()
})
output$tb <- renderUI({
if(is.null(data())){
return()
}else{
tabsetPanel(tabPanel("Data", tableOutput("datatable")))
}
})
}
shinyApp(ui = ui, server = server)
I made a change in one of the functions. Instead of using "renderTable" I used "renderDataTable". Th error is gone, but when I click on the tab, the data does not get displayed