小编Apo*_*los的帖子

将算术运算符视为函数

我已经读过R中的所有东西都是功能.所以我想知道"+"是否也是一个函数,如果我们可以写出类似的东西:

xx <- c(1,2,3)
yy <- c(1,2,3,4,5,6)

# zz is the sum of the two lengths
zz <- +(if(exists("xx")) length(xx), if(exists("yy")) length(yy))
Run Code Online (Sandbox Code Playgroud)

syntax r function

14
推荐指数
1
解决办法
529
查看次数

标签 统计

function ×1

r ×1

syntax ×1