完成R Programming第三周

这周作业有点绕,更多地是通过一个缓存逆矩阵的案例,向我们示范【词法作用域 Lexical Scopping】的功效。但是作业里给出的函数有点绕口,花费了我们蛮多心思。

Lexical Scopping:

The value of free variables are searched for in the environment where the function was defined。

因此

make.power<-function(n){
        pow<-function(x) {
                x^n
        }
}
View Code

相关文章: