Error: unused arguments in Shiny (R)

…衆ロ難τιáo~ 提交于 2020-02-23 10:20:34

问题


I wanted to begin by modifying a few components of one of the basic shiny example apps, but I keep getting this error:

ERROR: unused arguments (fluidRow(column(4, tags$hr(),
 verbatimTextOutput("out1"), selectInput("in1", "Options", choices =
 state.name, multiple = TRUE, selectize = FALSE))), fluidRow(column(4,
 tags$hr(), verbatimTextOutput("out2"), selectInput("in2", "Options",
 choices = state.name, multiple = TRUE, selectize = FALSE))))

Here is my code:

ui.R

library(shiny)
library(shinythemes)

shinyUI(fluidPage(theme=shinytheme("flatly"),
  #Application Title
  headerPanel("States"),
  br(),
  fluidRow(
    column(4, 
           tags$h4("Choose One or Multiple States"))
  )),
  fluidRow(
    column(4,
           tags$hr(),
           verbatimTextOutput('out1'),
           selectInput('in1', 'Options', choices = state.name, multiple = TRUE, selectize = FALSE)
           )
  ),
  fluidRow(
    column(4,
           tags$hr(),
           verbatimTextOutput('out2'),
           selectInput('in2', 'Options', choices= state.name, multiple = TRUE, selectize = FALSE))
  ))

===============================================

server.R

sessionInfo()
install.packages("shiny")
library(shiny)

View(headcount)
attach(headcount)
headcount.crn=as.array(CRN)


shinyServer(function (input, output, session) {
  output$out1 <- renderPrint(input$in1)
  output$out2 <- renderPrint(input$in2)
  })

回答1:


That error usually means that you messed up your commas or brackets somewhere. In your case, there's one too many closing brackets ()) at the end of the first fluidRow that's closing the fluidPage prematurely




回答2:


In my case this was coming from the ambiguity when I loaded two packages using library(packageName) both having the same function name. So anyone who ended up here debugging can also consider that possibility in case whats written above is not the case.



来源:https://stackoverflow.com/questions/31325864/error-unused-arguments-in-shiny-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!