R 在一个闪亮的应用程序中,如何将过滤后的数据帧传递给左连接?
我在应用程序外部尝试过,但似乎无法在应用程序内部实现 从应用程序中选择示例代码(相关位): 我希望能把这个传给一个阴谋。它在控制台中显示此错误: ggplot中出错:找不到对象“mapdata” 以及应用程序中的以下内容: 错误:找不到对象“mapdata” 在调试器R 在一个闪亮的应用程序中,如何将过滤后的数据帧传递给左连接?,r,join,shiny,R,Join,Shiny,我在应用程序外部尝试过,但似乎无法在应用程序内部实现 从应用程序中选择示例代码(相关位): 我希望能把这个传给一个阴谋。它在控制台中显示此错误: ggplot中出错:找不到对象“mapdata” 以及应用程序中的以下内容: 错误:找不到对象“mapdata” 在调试器选项(shinny.error=browser)中,我得到了以下信息: function (e) { if (inherits(e, "shiny.silent.error")) return() ha
选项(shinny.error=browser)
中,我得到了以下信息:
function (e)
{
if (inherits(e, "shiny.silent.error"))
return()
handle <- getOption("shiny.error")
if (is.function(handle))
handle()
}
函数(e)
{
if(继承(e,“shinny.silent.error”))
返回()
处理这应该有效
server <- function(input, output) {
#selected data
selectedData <- reactive({
data %>%
filter(Indicator == input$indicator)
})
#map data
mapData <- reactive({
left_join(poly, selectedData())
})
output$ggplot_id <- renderPlot({
ggplot(data = mapData()) +
... #further definitions for your plot
})
}
您可能需要的服务器左连接(poly,selectedData())
谢谢。它对我不起作用。我添加了一些其他信息。这是与以前相同的错误消息。在你的代码中,你返回的是你正在命名的对象,即第三行mapData,那么我该如何修复它?谢谢。它仍然对我不起作用。我添加了一些其他信息,但它不起作用认知mapdata表。谢谢你的回答。它对我不起作用。我可能需要多玩玩一点。实际上它确实起作用了。我用的是mapdata而不是mapdata。
Indicator <- iris %>% distinct(Species)
selectedData <- iris %>% group_by(Species) %>% summarise(mean = mean(Sepal.Length))
function (e)
{
if (inherits(e, "shiny.silent.error"))
return()
handle <- getOption("shiny.error")
if (is.function(handle))
handle()
}
server <- function(input, output) {
#selected data
selectedData <- reactive({
data %>%
filter(Indicator == input$indicator)
})
#map data
mapData <- reactive({
left_join(poly, selectedData())
})
output$ggplot_id <- renderPlot({
ggplot(data = mapData()) +
... #further definitions for your plot
})
}