I've some experience in R and am learning Spark 1.6.1 by first exploring the implementation of R in Spark.

I noticed that the syntax for the R sample() command is different in Spark:

base::R: `sample(x, size, replace)`

Spark R: `sample(DataFrame, withReplacement, fraction)`

`base::sample(x, size, replace)` still works, but is masked by the Spark R version.

Does anyone know why this is, when most commands are identical between the two?

Are there use cases that I should use one versus the other?

Has anyone found an authoritative list of differences between Spark R and base:: R?

Thanks!