4
votes

When I try to knit a RMarkdown document with ggvis plots to Word, I get the following message from Rstudio.

Error: Functions that produce HTML output found in document targeting docx output.
Please change the output type of this document to HTML.
Execution halted

Does there exist an elegant solution (without too much effort) to make this possible, perhaps using export_png and vg2png?

2

2 Answers

1
votes

Here is an example:

```{r setup, include=FALSE}
library(dplyr)
library(ggvis)
```

The following table looks fine...
As long as I don't include this plot below

```{r, echo=FALSE, include=FALSE}
p <- pressure %>%
  ggvis(x = ~temperature, y = ~pressure) %>%
  layer_bars()
export_png(p, file = "hoge.png")
```

![](hoge.png)

enter image description here

If you will use this frequently, you can define hook.

-1
votes
  1. First go to Node JS Download page
  2. After instaling node.js, in terminal run:

    npm install vega