示例不在sparkR会话中工作

时间:2015-07-03 00:08:27

标签: r apache-spark

我在我的机器上安装了Spark-1.4.0,运行了fedora 21,内核4.0.5-200.fc21.x86_64,我运行了install-dev.sh spark-1.4.0 / R目录。现在当我在终端上启动'sparkR'时,一切都正常启动,我进入命令提示符并执行以下操作:

> sample(seq(1,10),size=4)
Error in sample(seq(1, 10), size = 4) : unused argument (size = 4)

我的问题是为什么'sample'会在SparkR控制台中抛出此错误。这适用于常规的R会话,即

> sample(seq(1,10),size=4)
[1]  1 10  4  2

1 个答案:

答案 0 :(得分:1)

感谢@daattali它确实被掩盖了。在sparkR会话中,我得到:

> sample
nonstandardGenericFunction for "sample" defined from package "SparkR"

function (x, withReplacement, fraction, seed) 
{
    standardGeneric("sample")
}
<environment: 0x2e4c810>
Methods may be defined for arguments: x, withReplacement, fraction, seed
Use  showMethods("sample")  for currently available ones.
>