Ggvis and data.table?

I am trying to run ggvis

in conjunction with data.table

, see code below. I am getting the following error:

Error in `:=`(mpg2, mpg/2) : 
  Check that is.data.table(DT) == TRUE. Otherwise, := and `:=`(...) 
  are defined for use     in j, once only and in particular ways. See help(":=").

      

If I run the line mtcars[ , mpg2 := mpg / 2]

in the console, no problem. So what's the problem? [I still doubt that both data.table

are ggvis

used :=

.

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

```{r echo = FALSE}
library(ggvis)
library(data.table)

mtcars %>%
  ggvis(x = ~wt, y = ~mpg) %>%
  layer_points()

mtcars = data.table(mtcars)
mtcars[, mpg2 := mpg / 2]  # gives error message

# code below does not work as the line above throws an error

mtcars %>%
  ggvis(x = ~wt, y = ~mpg2) %>%
  layer_points()

      

``,

data.table

version 1.9.2

ggvis

from github 0.3.0.9001 as the CRAN version complained about missing knit_print

.

+3


source to share


1 answer


I upgraded to data.table 1.9.3 and everything works as it is now. Thank!



0


source







All Articles