r - 闪亮的仪表板产生此错误:您将函数作为全局数据传递。您是否拼错了 `ggplot()` 中的 `data` 参数
问题描述
我在哪里犯错?是什么导致了这个错误?谢谢。以下是完整的错误消息: Listening on http://127.0.0.1:7891
警告:错误:您将函数作为全局数据传递。你把data
论点拼错了吗ggplot()
library(shiny)
library(dplyr)
library(ggplot2)
COV <- read.csv('pathway', stringsAsFactors = F)
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
selectInput("selectInput1",
"Select PID:",choices = unique(COV$PID),
selected = "1000"),
selectInput("selectInput2",
"Select Parent Identifier",
choices = unique(COV$M_CM),
selected = "1"),
selectInput("selectInput3",
"Select x variable:",
choices = names(COV),
selected = "StartDate"),
selectInput("selectInput4",
"Select y variable:",
choices = names(COV),
selected = "COV_WOR")
),
mainPanel(
plotOutput('plot')
)
)
)
server <- function(input,output){
selectedData <- reactive({
COV[COV$PID == input$selectInput1 & COV$M_CM == input$selectInput2, c(input$selectInput3, input$selectInput4)]
})
output$plot <- renderPlot({
# Use aes_string for column names stored in strings
p <- ggplot(selectedData, aes_string(x = input$selectInput3, y = input$selectInput4))+
geom_line()
p
})
}
shinyApp(ui,server)
解决方案
推荐阅读
- video - 用于颜色转换的 OpenImageI/O python 绑定失败
- tsql - T-SQL Pivot 关键字“FOR”附近的语法不正确
- ruby-on-rails - 如何在rails中添加版本字段(1.0.1)
- paypal - 我正在使用 paypal rest api 的计费计划,我需要知道 api 计费计划是否会影响
- angularjs - AngularJS - 循环中的多个 $http 递归调用
- rest - Bitbucket 服务器:REST API 仅返回公共存储库,不返回私有存储库
- autodesk - Revit 插件(未出现在 Revit 中)
- c - 从 C 中的 bash 创建一个 AST
- c - 更换开关盒中的 goto
- c# - 嵌套列表上的 Linq c#