我搜索了一个参考,以了解R中的替换函数,但我还没有找到.我试图理解R中替换函数的概念.我有下面的代码,但我不明白它:
"cutoff<-" <- function(x, value){
x[x > value] <- Inf
x
}
Run Code Online (Sandbox Code Playgroud)
然后我们用以下方式调用cutoff:
cutoff(x) <- 65
Run Code Online (Sandbox Code Playgroud)
谁能解释R中的替换功能是什么?
r ×1