交互式R Markdown中ggvis图的大小错误

时间:2015-07-09 03:14:00

标签: r plot shiny r-markdown ggvis

我正在尝试在交互式R Markdown文件中添加交互式ggvis图。它工作正常,除了绘图的大小大于指定的空间,我总是得到一个“切割”情节和滚动条。我尝试了块选项(out.height和fig.height)或没有成功的ggvis set_options。以下是一个例子。 感谢

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

```{r, echo = FALSE}
library(ggvis)
mtcars %>%
  group_by(am) %>%
  ggvis(~ x_, ~ count_/sum(count_), fill = ~am) %>%
  compute_bin(~mpg, width = input_slider(min = 1, max = 10)) %>%
    layer_bars(stack = FALSE, opacity := 0.5) %>%
  add_axis("x", title = "mpg", grid = FALSE) %>%
  add_axis("y", title = "Proportion", grid = FALSE, format = "%")
```

0 个答案:

没有答案