r - RShiny 不会向服务器输出任何结果。'服务器错误(...):未使用的参数(输出=列表(, 函数 (x) x))'
问题描述
我的 Rshiny 应用程序不会放置我想要的相关图,我不确定为什么。运行代码时出现此错误。
Warning: Error in server: unused argument (output = list(<environment>, function (x) x))
[No stack trace available]
Error in server(...) :
unused argument (output = list(<environment>, function (x) x))
这是我正在使用的代码:
library(shiny)
library(shinydashboard)
combined1 = read.csv("combined.csv", stringsAsFactors=F, na.strings=c(NA,"NA"," NA", "na"))
ui <- dashboardPage(
dashboardHeader(title = "NBA Draft"),
dashboardSidebar(),
dashboardBody(
box(plotOutput("correlation_plot"), width = 8),
box(
selectInput("features", "Features:",
c("Pts", "Ast", "Trb",
"WS.48")), width = 4
)
)
)
server <- function(input, outout){
outout$correlation_plot <- renderPlot({
plot(combined1$Pk, combined1[[input$Features]],
xlab = "Pk", ylab = "Features")
})
}
shinyApp(ui, server)
我不知道为什么会出现此错误,有人可以帮我吗?
解决方案
试试这个:
library(shiny)
library(shinydashboard)
combined1 = read.csv("combined.csv", stringsAsFactors=F, na.strings=c(NA,"NA"," NA", "na"))
ui <- dashboardPage(
dashboardHeader(title = "NBA Draft"),
dashboardSidebar(),
dashboardBody(
box(plotOutput("correlation_plot"), width = 8),
box(
selectInput("features", "Features:",
c("Pts", "Ast", "Trb",
"WS.48")), width = 4
)
)
)
server <- function(input, output){
output$correlation_plot <- renderPlot({
plot(combined1$Pk, combined1[[input$Features]],
xlab = "Pk", ylab = "Features")
})
}
shinyApp(ui, server)
该变量应称为输出而不是outout
推荐阅读
- marklogic - 从java调用marklogic模块函数并将输出返回到java的最佳方法是什么
- node.js - 当对象不存在时,headObject 永远不会抛出错误
- javascript - 如何下载语言环境 TTS
- django - 运行 Django 时的 StatReloader 是什么?
- cucumber-jvm - 如何使用最新的 io.cucumber.cucumber-testng 版本 4.2.6 编写自定义的 TestNGCucumberRunner
- typescript - 如何选择赛普拉斯自动完成字段
- gps - ublox GPS 奇怪字符穿插 NMEA 输出
- php - 为 Hangouts Webhook 构建 PHP 数组
- excel - 将工作表对象传递给另一个子获取“对象不支持此属性或方法”
- sql - 如何将表更新为子查询中的值