Search code examples
rdata.tableggvis

ggvis use of " := " in combination with data.table


When starting up ggvis I get the message :

The following object is masked from ‘package:data.table’:

:=

That := is essential for running data.table, which happens to be the alternative for dplyr.

My code still runs correctly, but the startup message worries me, since I use data.table in all my scripts.

What are the consequences of using := in both data.table and ggvis, given the startup message of ggvis?


Solution

  • Both ggvis and data.table have that function defined to prevent that operator from being used outside of the correct syntax (within correct syntax the packages don't let R handle the parsing and that function doesn't get called). You can check what exactly each one does by typing ggvis::":=" and data.table::":=" (they both just call stop unconditionally).

    So the only consequence is going to be a somewhat weird error message if you screw up the syntax (e.g. getting the data.table error message in ggvis or vice versa, depending on which package you load first).