R6 级错误 __Deferred_Default_Marker__

R6Class bug __Deferred_Default_Marker__

我正在实施一个新的 R6Class 并尝试动态添加新成员 (https://cran.r-project.org/web/packages/R6/vignettes/Introduction.html#adding-members-to-an-existing-class) 但我收到此错误 "__Deferred_Default_Marker__"(无论它是动态的还是非动态的)当我实现 getx2 函数时。

Simple <- R6Class("Simple",
                  public = list(
                     x = 1,
                     getx = function() self$x,
                     getx2 = function() return(self$x * 2)
                  )
)

# To replace an existing member, use overwrite=TRUE
Simple$set("public", "x", 10, overwrite = TRUE)

s <- Simple$new()
s$getx2() # this returns "__Deferred_Default_Marker__"

对此有什么想法吗?与文档中的完全一样

解决方案是更新软件包。以下指令的问题:

devtools::install_github('r-lib/R6', build_vignettes = FALSE)

它是否给我带来了以下错误:namespace 'R6' is imported by 'CompatibilityAPI', 'mrsdeploy' so cannot be unloaded"

所以我关闭了 RStudio,并打开了 R.exe (C:\Program Files\R\R-3.3.3\bin) 和 运行 相同的命令。现在,我有这个包裹:

Package: R6
Version: 2.2.2.9000
URL: https://github.com/r-lib/R6/

它按照规范工作。