Created
March 6, 2016 19:10
-
-
Save stephlocke/620dc16e6d99bf7fc477 to your computer and use it in GitHub Desktop.
vegalite incompatability with ggvis in rmarkdown
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Error in vis$data[[name]] <- data : | |
| invalid type/length (closure/0) in vector allocation | |
| Calls: <Anonymous> ... eval -> _fseq -> freduce -> <Anonymous> -> add_data | |
| Execution halted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| output: html_document | |
| --- | |
| ```{r setup, include=FALSE} | |
| knitr::opts_chunk$set(echo = TRUE) | |
| # Not on CRAN | |
| if(!require(devtools)) install.packages("devtools") | |
| if(!require(vegalite)) devtools::install_github("hrbrmstr/vegalite") | |
| if(!require(ggvis)) install.packages("ggvis") | |
| ``` | |
| ```{r vegalite, eval=TRUE} | |
| library(vegalite) | |
| vegalite() %>% | |
| add_data(Seatbelts) %>% | |
| encode_x("PetrolPrice","quantitative") %>% | |
| encode_y("DriversKilled", "quantitative") %>% | |
| mark_point() | |
| ``` | |
| ```{r ggvis, eval=FALSE} | |
| library(ggvis) | |
| Seatbelts %>% data.frame %>% | |
| ggvis(~PetrolPrice, ~DriversKilled) %>% | |
| layer_points() | |
| ``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment