繁体   English   中英

如何从函数包ff(在R中)重载函数“[< - 。ffdf”和“[.ffdf”]?

[英]How to overload the functions “[<-.ffdf” and “[.ffdf” from package ff (in R)?

我遇到过来自ff包的写入错误。 这个答案表明解决方案可能是重载函数“[< - 。ffdf”和“[.ffdf”。 有人可以详细说明这一点,或至少建议我需要弄清楚什么是必要的,以实现这一目标。 请记住,这个问题来自新手。

只需重写“[< - 。ffdf”和“[.ffdf”函数。

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
}

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM