Issue on using R6 classes and foreach() %dopar% together
问题 I'm having an issue on R6 classes when used with foreach() together, possibly to do with environments (I'm using Windows). Suppose that there are two R6 classes, "class1" and "class2". method1 in class1 is dependent on class2 (see example code below for example). The issue is, if I use foreach() %dopar% on class1, R doesn’t seem to recognise class2, even if I set .export = c("class1", "class2") explicitly in foreach() statement. (Here class1 uses class2) However if I use foreach() on class2,