【问题标题】:How to overload the functions "[<-.ffdf" and "[.ffdf" from package ff (in R)?如何从包ff(在R中)中重载函数“[<-.ffdf”和“[.ffdf”?
【发布时间】:2014-05-12 08:57:05
【问题描述】:

我遇到了 ff 包的写入错误。 This answer 建议解决方案是重载函数“[

【问题讨论】:

    标签: r overloading ff ffbase


    【解决方案1】:

    只需重写“[

    require(ff)
    ## For the assignment
    get("[<-.ffdf")
    args(get("[<-.ffdf"))
    "[<-.ffdf" <- function (x, i, j, value){
      ## put your code in here and make sure it does not open too many ff files which are in x
    }
    ## For the getter
    args(get("[.ffdf"))
    "[.ffdf" <- function (x, i, j, drop = ncols == 1){
      ## put your code in here and make sure it does not open too many ff files which are in x
    }
    

    【讨论】:

      【解决方案2】:

      另一种解决方案是增加系统设置以允许同时打开更多文件。该系统设置是 ff 数据帧的限制因素。我解释了如何更改此设置on SO here

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2014-04-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-08-09
        • 1970-01-01
        相关资源
        最近更新 更多