簡體   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