Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用plot_在flexdashboard中单击_R_Shiny_Flexdashboard - Fatal编程技术网

使用plot_在flexdashboard中单击

使用plot_在flexdashboard中单击,r,shiny,flexdashboard,R,Shiny,Flexdashboard,是否有一种使用flexdashboard进行鼠标交互绘图的方法 在中国,这并不困难。我想保存鼠标点击,在闪亮的UI中我会使用: mainPanel(plotOutput("scatterplot", click = "plot_click")) 在服务器中,您将拥有: df <- reactiveValues(Clicksdf = data.frame(clickx = numeric(), clicky = numeric())) 我可以在flexdashboard中这样做吗?编写代

是否有一种使用flexdashboard进行鼠标交互绘图的方法

在中国,这并不困难。我想保存鼠标点击,在闪亮的UI中我会使用:

mainPanel(plotOutput("scatterplot", click = "plot_click"))
在服务器中,您将拥有:

df <- reactiveValues(Clicksdf = data.frame(clickx = numeric(), clicky = numeric()))

我可以在flexdashboard中这样做吗?

编写代码块,就像它是闪亮的UI和服务器一样:

---
title: "Untitled"
runtime: shiny
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
---

```{r setup, include=FALSE}
library(flexdashboard)
library(shiny)
```

Column {data-width=650}
-----------------------------------------------------------------------

### Chart A

```{r}
plotOutput("plot1", click = "wt")
output$plot1 <- renderPlot({
  plot(mtcars$mpg ~ mtcars$wt)
  })
```

Column {data-width=350}
-----------------------------------------------------------------------

### Chart B

```{r}
renderText({
  unlist(input$wt$x)
})
```

我把它标为被接受的答案。不幸的是,这是我的第一篇文章,所以我没有足够的声誉来提升它,但当我这样做的时候,我会回来并提升它。再次感谢!别担心。非常感谢。