简体   繁体   English

Shiny 错误:警告:seq.int 中的错误:'to' 必须是有限数

[英]Shiny Error : Warning: Error in seq.int: 'to' must be a finite number

I am new to Shiny and I am not sure why I get an error.我是 Shiny 的新手,我不确定为什么会出现错误。

I already have created a function that takes an input a variable "name" and then after some lines I simply end by print(plot 1) print(plot 2).我已经创建了一个 function,它接受一个变量“名称”的输入,然后在一些行之后,我简单地以 print(plot 1) print(plot 2) 结束。 Now I want to make this function reactive using shiny.现在我想使用 shiny 使这个 function 具有反应性。

I have already in my R session environment run the dataframe & the function.我已经在我的 R session 环境中运行 dataframe 和 ZC1C425268E68394F1C14 Then I run the shiny app using this code but I get this error.然后我使用此代码运行 shiny 应用程序,但出现此错误。 Do you have any idea what could be the issue?你知道可能是什么问题吗? :/ :/

Warning: Error in seq.int: 'to' must be a finite number警告:seq.int 中的错误:'to' 必须是有限数

library(shiny)

ui <- fluidPage(
  headerPanel("Change graph"), 
  sidebarPanel(
    selectInput(
      "playlist", "Select a Playlist Name", playlist_names)
    ),
  mainPanel(plotOutput("plot1"))
  
  
)

server <- function(input, output) {
  output$plot1<-renderPlot({playlist_name_plots("input$playlist")})
}


shinyApp(ui = ui, server = server)

You need to specify what's in playlist_names passed as choices = , quoted from ?selectinput :您需要指定作为choices =传递的playlist_names中的内容,引用自?selectinput

List of values to select from. select 的值列表来自。 If elements of the list are named, then that name — rather than the value — is displayed to the user.如果列表的元素被命名,那么该名称——而不是值——将显示给用户。 It's also possible to group related inputs by providing a named list whose elements are (either named or unnamed) lists, vectors, or factors.还可以通过提供一个命名列表来对相关输入进行分组,该列表的元素是(命名或未命名)列表、向量或因子。 In this case, the outermost names will be used as the group labels (leveraging the HTML tag) for the elements in the respective sublist.在这种情况下,最外面的名称将用作相应子列表中元素的组标签(利用 HTML 标记)。 See the example section for a small demo of this feature.有关此功能的小演示,请参阅示例部分。

Working example:工作示例:

library(shiny)

playlist_names <- c("Playlist A","Playlist B","Playlist C")

ui <- fluidPage(
  headerPanel("Change graph"), 
  sidebarPanel(
    selectInput(
      "playlist", "Select a Playlist Name", playlist_names)
  ),
  mainPanel(plotOutput("plot1"))
  
  
)

server <- function(input, output) {
  output$plot1<-renderPlot({playlist_name_plots(input$playlist)})
}


shinyApp(ui = ui, server = server)

暂无
暂无

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

相关问题 错误 ggplot(seq.int(0, to0 - from, by) 中的错误:&#39;to&#39; 必须是有限的) - Error ggplot (Error in seq.int(0, to0 - from, by) : 'to' must be finite) 如何解决ggplot中的“seq.int(0,to0 - from,by)中的错误:'to'必须是有限数”? - How to solve "Error in seq.int(0, to0 - from, by) : 'to' must be a finite number" in ggplot? seq.int中的错误(r1 $ year,to $ year,by):&#39;from&#39;必须是有限数字 - Error in seq.int(r1$year, to$year, by) : 'from' must be a finite number R:指定 dateRangeInput 之间的日期 - “seq.int 中的错误:'to' 必须是有限数” - R: Specifying dates between dateRangeInput - “Error in seq.int: 'to' must be a finite number” seq.int(r1$mon, 12 (to0$year - r1$year) + to0$mon, by) 中的错误:from 必须是有限数 - Error in seq.int(r1$mon, 12 (to0$year - r1$year) + to0$mon, by) : from must be a finite number Knit 文档导致 seq.int 出错 - Knit Document Results in Error in seq.int "运行App时如何消除“警告:seq.default中的错误:&#39;from&#39;必须是有限数”?" - How to eliminate "Warning: Error in seq.default: 'from' must be a finite number" when running App? seq.int(0, to0 - from, by) 中的错误:&#39;by&#39; 参数中的错误符号 - Error in seq.int(0, to0 - from, by) : wrong sign in 'by' argument gganimate 错误:seq.default 中的错误(范围 [1],范围 [2],长度.out = nframes):'from' 必须是有限数 - gganimate error: Error in seq.default(range[1], range[2], length.out = nframes) : 'from' must be a finite number seq.int(0, to0 - from, by) 中的错误是什么意思:r 中的“by”参数中的错误符号 - What its mean by Error in seq.int(0, to0 - from, by) : wrong sign in 'by' argument in r
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM