简体   繁体   English

警告:cat 中的错误:R shiny webtool 中的 'cat' [No stack trace available] 无法处理参数 1(类型 'list')

[英]Warning: Error in cat: argument 1 (type 'list') cannot be handled by 'cat' [No stack trace available] in R shiny webtool

Im developing shiny webtool for R functions to generate the indices results on the webtool.我正在为 R 函数开发 shiny webtool,以在 webtool 上生成索引结果。

I have 6 R functions and i created 6 combinations in selectinput widget, where each combination is linked with the one R function each.我有 6 个 R 函数,我在 selectinput 小部件中创建了 6 个组合,其中每个组合都与一个 R function 链接。

The 6 R functions are as follows: 6个R函数如下:

RSCU(file){script}, RSCU(文件){脚本},

cgr_res(file){script}, cgr_res(文件){脚本},

zscore_cal(file){script}, zscore_cal(文件){脚本},

GC_Content7(file){} and GC_Content7(file){} 和

extractmod(file){script} all these 5 functions have single and same arguments ie, input file as same input argument for all five R functions and last R function that is 6th R function have AMIP(file,n1,n2) 3 input arguments here input file is same as remaining 5, but n1 and n2 are different arguments, for n1 and n2 arguments I created numericalInput() widget. extractmod(file){script} all these 5 functions have single and same arguments ie, input file as same input argument for all five R functions and last R function that is 6th R function have AMIP(file,n1,n2) 3 input arguments这里输入文件与其余 5 个相同,但 n1 和 n2 不同 arguments,对于 n1 和 n2 arguments 我创建了 numericInput() 小部件。 For GC_content7,RSCU, cgr_res and zscore_cal, webtool is working fine but for other two functions no results are displaying.对于 GC_content7、RSCU、cgr_res 和 zscore_cal,webtool 工作正常,但对于其他两个函数,没有显示结果。

     library("shinythemes")
  library("shiny")
  library("htmltools")
  library("bsplus")
  library("DT")
  library("shinyalert")
  library("shinyjs")
  library("shinycssloaders")
  library("dplyr")
  library("data.table")
  library("reshape2")
  library("ggplot2")
  library("plotly")
  library("tools")
  library("readxl")
  library("writexl")
  library("seqinr")
  library("Biostrings")
  library("BiocManager")
  library("entropy")
  library("protr")
  
  source("GS_Source.R")
  
  ui = fluidPage(
    headerPanel(
      h1(tags$strong("Welcome to Web based Tool for Computation of Genomic"),
         style = "font-size: 20pt; line-height: 30pt; width = 100; color: #Red",
         align = "center"),
      windowTitle = "Home"),
    
    sidebarLayout(
      sidebarPanel(
        style = "background-color: #E52B50;",
        tags$style(type='text/css', 
                   "label { font-size: 12px; }",
                   ".selectize-input { font-size: 12pt; line-height: 12pt;}, 
                   .selectize-dropdown { font-size: 12pt; line-height: 12pt; }"),
        
        fileInput('file', HTML('<p style="color:#4A2768; font-size: 12pt"> Choose file to upload the expression data </p>'),accept = c('text/csv','text/comma-separated-values',
                                                                                                                                       'text/tab-separated-values','text/plain','.csv', '.tsv','.fasta')),
        
        selectInput("Signatures", HTML('<p style="color:#4A27C5; font-size: 12pt"> Genome signature </p>'), 
                    c("GC-content","RSCU","CGR","DI-nuculeotide odd Ratio","AAC","AMIP")),
        numericInput("num1",label = "FROM",value = 2),
        numericInput("num2", label = "TO", value = 3),
      
        useShinyalert(),
        actionButton("action", tags$b("Submit")), width = 3,  style="color: #fff; background-color: #337ab7; border-color: #2e6da4"),
      mainPanel(
       verbatimTextOutput("res1"),
        verbatimTextOutput("res2"),
       plotOutput("res3"),
       verbatimTextOutput("res4"),
       verbatimTextOutput("res5"),
       verbatimTextOutput("res6"),
        
      )
    )
  )
  
  server <- function(input, output, session) {
  
  
   
    
  
  df <- eventReactive(input$action, {
                      my_func <- switch(input$Signatures,
                                       
                                       "RSCU" = RSCU,
                                       "CGR"=cgr_res,
                                       "DI-nuculeotide odd Ratio"=zscore_cal,
                                       "GC-content" = GC_content7,
                                       "AAC"=extractAAC_mod,
                      )
                     
                      my_func(input$file$datapath)
                     
  })
  
  df1 <- eventReactive(input$actions, { 
                   my_func1 <- switch(input$signatures, 
                          "AMIP"=AMIP,
  )
     my_func1(input$file$datapath,input$num1,input$num2)
  })
  
  

  
  output$res1 <- renderPrint({
    req(input$Signatures)
    if (input$Signatures=="GC-content") {
      
      df()
    }
  })
  
  output$res2 <- renderPrint({
    req(input$Signatures)
    if (input$Signatures=="RSCU") {
      
      df()
    }
  })
    
  output$res3 <- renderPlot({
    req(input$Signatures)
    if (input$Signatures=="CGR") {
      
      df()
    }
  })
  
  output$res4 <- renderPrint({
    req(input$Signatures)
    if (input$Signatures=="DI-nuculeotide odd Ratio") {
      
      df()
    }
  })                    
  output$res5 <- renderPrint({
    req(input$Signatures)
    if (input$Signatures=="AAC") {
      
      df()
    }
  })
  
  output$res6 <- renderPrint({
   req(input$signatures)
    if(input$signatures=="AMIP"){
      df1()
      }
    
 })
  
  observeEvent(input$action, {
    shinyalert(title = "Please wait for the results...", type = "success")
  })
  
  }
  
  shinyApp(ui, server)

One cannot return a list in renderText .无法在renderText中返回列表。 You can use renderPrint instead of renderText and verbatimTextOutput instead of textOutput .您可以使用renderPrint代替renderTextverbatimTextOutput代替textOutput

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 R - 闪亮| cat中的错误(列表(...),文件,sep,fill,labels,append):&#39;cat&#39;无法处理参数1(类型&#39;list&#39;) - R - Shiny | Error in cat(list(…), file, sep, fill, labels, append) : argument 1 (type 'list') cannot be handled by 'cat' 尝试使用R中的闪亮应用程序创建一个未来值计算器并得到错误:“ cat”无法处理参数1(类型“ closure”) - Trying to create a future value calculator with shiny app in R and get error: argument 1 (type 'closure') cannot be handled by 'cat' 问题打印回归树,“cat(x, ..., sep = sep) 中的错误:参数 1(类型‘list’)无法由‘cat’处理” - Problem Printing Regression Tree, "Error in cat(x, ..., sep = sep) : argument 1 (type 'list') cannot be handled by 'cat'" R Shiny 错误:没有可用的堆栈跟踪和无效的下标类型“列表” - R Shiny error : no stack trace available and invalid subscript type 'list' 闪亮的应用程序失败,“参数1(类型&#39;封闭&#39;)无法由&#39;猫&#39;处理” - 这是什么意思? - Shiny app fails with “argument 1 (type 'closure') cannot be handled by 'cat'” - what does this mean? 对档案进行闪亮的反应式扫描,然后将其写入()以下载,在cat()-&gt;参数类型“关闭”中未处理失败 - Shiny reactive scan of archive, then write() it to download, fails in cat() -> argument type “closure” not handled 如何解释写入错误(mydata,“mydata.csv”)? “列表”不能由“猫”处理? - How to interpret error in write(mydata, “mydata.csv”)? “List” cannot be handled by “cat”? cat()输出整数而不是R中的列表值 - cat() outputs integers instead of list values in R 在数据类型列表上使用cat函数 - Using cat function on data type list 定期捕获Cat输出以进行R闪亮输出(renderPrint) - capturing cat output periodically for R shiny output (renderPrint)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM