【发布时间】:2013-06-03 01:22:11
【问题描述】:
我对@987654321@ 在 R 和 S-plus 中的工作方式感到困惑。对于以下代码
pp <- function(x, ...) { print( length( list(...)))}
pp(1,,,1)
在 S-Plus 中,它可以工作,但在 R 中,它给出“Error in print(length(list(...))) : argument is missing, with no default”
我对它在 R 中的工作原理以及如何在 R 函数中获取 list(...) 的值更感兴趣。
【问题讨论】:
-
我只是建议您删除现有版本中多余的逗号:
pp(1,1)然后pp(1,2,3)应该返回 1 和 2。