简体   繁体   中英

Unable to publish Shiny R data table

This is the first project I design with RStudio and Shiny. Thus I believe there is some trivial issue I cannot understand yet.

I am attempting to publish two large tables as a Shiny R App online, using shinyapps.io. The code works fine locally but the tables will not show online when published. See below

https://myrmeco-fox.shinyapps.io/Transcriptome_Table/

My scripts as follows:

require(shiny)
require(DT)
ui <- fluidPage(
  title = "Summary of de novo assembly annotations",
  mainPanel(
    tabsetPanel(
      id = 'dataset',
      tabPanel("Contigs", DT::dataTableOutput("mytable1")),
      tabPanel("Isotigs", DT::dataTableOutput("mytable2"))
    )
  )
)

server <- function(input, output) {
  Contigs<-reactiveValues(Contigs_Table=read.table("Data/annotations_expanded_CONTIGS.txt", header= TRUE, sep = "\t", fill = TRUE, na.strings = c("", "---NA---"), nrows=7467, colClasses="character", quote=""))
  class(Contigs_Table$Length)<-"numeric"
  class(Contigs_Table$Cys)<-"numeric"
  Isotigs<-reactiveValues(Isotigs_Table=read.table("Data/Annotation_summary_expanded_ISOTIGS", header= TRUE, sep = "\t", fill = TRUE, na.strings = c("", "---NA---"), nrows=12538, colClasses="character", quote=""))
  class(Isotigs_Table$Length)<-"numeric"
  class(Isotigs_Table$Cys)<-"numeric"
  output$mytable1 = renderDataTable(Contigs_Table, options = list(pageLength = 5))
  output$mytable2 = renderDataTable(Isotigs_Table, options = list(pageLength = 5))
}

shinyApp(ui, server)

UI

ui <- fluidPage(
  title = "Summary of de novo assembly annotations",
  mainPanel(
    tabsetPanel(
      id = 'dataset',
      tabPanel("Contigs", DT::dataTableOutput("mytable1")),
      tabPanel("Isotigs", DT::dataTableOutput("mytable2"))
    )
  )
)

SERVER

server <- function(input, output) {
  source("Data.R")
  class(Contigs_Table$Length)<-"numeric"
  class(Contigs_Table$Cys)<-"numeric"
  class(Isotigs_Table$Length)<-"numeric"
  class(Isotigs_Table$Cys)<-"numeric"
  output$mytable1 = renderDataTable(Contigs_Table, options = list(pageLength = 5))
  output$mytable2 = renderDataTable(Isotigs_Table, options = list(pageLength = 5))
}

DATA

Contigs<-reactiveValues(Contigs_Table=read.table("Data/annotations_expanded_CONTIGS.txt", header= TRUE, sep = "\t", fill = TRUE, na.strings = c("", "---NA---"), nrows=7467, colClasses="character", quote=""))
Isotigs<-reactiveValues(Isotigs_Table=read.table("Data/Annotation_summary_expanded_ISOTIGS", header= TRUE, sep = "\t", fill = TRUE, na.strings = c("", "---NA---"), nrows=12538, colClasses="character", quote=""))

I have followed instructions from several discussions, such as adding the files to a subfolder (they are uploaded as well) and using reactiveValues. I have slightly changed syntax (with and without dot, etc) and still nothing worked.

:) what about putting "/" in front of Data? I assume your data is in this Data subfolder?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM