3

ggvis はまだ Shiny Documents で動作していますか?

この例では、ggplot は表示されますが、ggvis は表示されません

---
title: "testShiny"
runtime: shiny
output: html_document
---

ggplot2

```{r, echo=FALSE}

require(ggplot2)

renderPlot({
  ggplot(women, aes(height, weight))+
    geom_point()+
    theme_bw()

  })

```

ggvis

```{r, echo=FALSE}

require(ggvis)

renderPlot({
  women %>%
    ggvis(x= ~height, y = ~weight) %>%
    layer_points()

  })

```

検索中にbind_shinyに出くわしましたが、問題は解決しませんでした

4

1 に答える 1

3

bind_shinyビジュアライゼーションに ID を割り当てるために使用する必要があります。次にggvisOutput、視覚化を表示するために DOM で要素を作成するために使用する必要があります。

---
title: "testShiny"
runtime: shiny
output: html_document
---

```{r, echo=FALSE}

require(ggvis)
require(knitr)
require(shiny)

ggvisOutput("p")

women %>%
  ggvis(x= ~height, y = ~weight) %>%
  layer_points()%>%
  bind_shiny("p")

```

ここに画像の説明を入力

于 2014-07-05T17:41:33.820 に答える