R无名函数调用

来源:互联网 发布:遥望网络 编辑:程序博客网 时间:2024/05/18 00:41

evaluate()

| Let’s use the evaluate function to explore how anonymous functions work. For the first argument of the
| evaluate function we’re going to write a tiny function that fits on one line. In the second argument we’ll
| pass some data to the tiny anonymous function in the first argument.

paste()

| As you can see the first argument of paste() is ... which is referred to as an ellipsis or simply
| dot-dot-dot. The ellipsis allows an indefinite number of arguments to be passed into a function. In the case
| of paste() any number of strings can be passed as arguments and paste() will return all of the strings
| combined into one string.

二元运算符号定义

“%p%” <- function(left, right){ # Remember to add arguments!
paste(left, right)
}

0 0