File: html_document.Rmd

package info (click to toggle)
r-cran-ggvis 0.4.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,716 kB
  • sloc: sh: 25; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 549 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
---
title: "Using ggvis with knitr and rmarkdown"
output:
  html_document:
    fig_width: 4
    fig_height: 2
---

```{r echo=FALSE}
# Set up default dimensions. Width and height are multiplied by dpi to get
# pixel dimensions.
knitr::opts_chunk$set(fig.width = 4, fig.height = 3)
```

To embed a ggvis plot just call `ggvis`:

```{r, message = FALSE}
library(ggvis)
mtcars %>% ggvis(x = ~wt, y = ~mpg) %>% layer_points()
```


```{r, fig.width = 8, fig.height = 6}
mtcars %>% ggvis(x = ~wt, y = ~mpg) %>%
  layer_points() %>%
  layer_smooths()
```