小编Sar*_*h W的帖子

ggiraph 图没有出现在闪亮的应用程序中,但在 RStudio 中有效

我真的很想用来ggiraph在我的shiny应用程序中添加工具提示。但是,当我尝试这样做时,情节不会出现。在下面的示例中,我使用了plotOutputandggiraphOutput但只my.plot出现了。我可以在 RStudio 中生成交互式绘图,而不是在应用程序中。我的实现有问题吗?或者可能存在兼容性问题(sessionInfo()如下)?谢谢!

library(ggiraph)
library(shiny)
library(ggplot2)
ui <- fluidPage(
  fluidRow(
    column(6,plotOutput(outputId ="my.plot")),
    column(6,ggiraphOutput(outputId = "interactive.plot"))
  )
)

server <- function(input, output){
  output$my.plot <- renderPlot({
    data = data.frame(x = 1:10, y= rnorm(10), z = 11:20)
    ggplot(data, aes(x = x, y = y)) + geom_col()

    #girafe(ggobj = xx)
  })
  output$interactive.plot <- renderggiraph({
    data = data.frame(x = 1:10, y= rnorm(10), z = 11:20)
    gg <- ggplot(data, aes(x = 1:10, y = …
Run Code Online (Sandbox Code Playgroud)

r shiny ggiraph

5
推荐指数
1
解决办法
362
查看次数

标签 统计

ggiraph ×1

r ×1

shiny ×1