Search code examples
rr-futurezeallot

Is it possible to use R's zeallot library with the future library?


This works fine:

library(zeallot)
c(v1, v2, v3) %<-% list(10, 20, 30)

This does not:

library(zeallot)
library(future)
c(v1, v2, v3) %<-% list(10, 20, 30)

because future overrides zeallot's parallel assignment operator.

The following objects are masked from ‘package:zeallot’:

    %->%, %<-%

Does this mean it is not possible to use zeallot with future?


Solution

  • I see two options.

    1. Ensure that zealot's %<-% takes precedence by loading zealot last.

      library(future)
      library(zeallot)
      c(v1, v2, v3) %<-% list(10, 20, 30)
      
    2. Use explicit namespace calling when using %<-% in functional (not infix) form.

      library(zeallot)
      library(future)
      zeallot::`%<-%`(c(v1, v2, v3), list(10, 20, 30))