Generate random deviates from a normal distribution
Generate random deviates from a normal distribution
new()Create a new Normal object.
Normal$new(sc, size, num_partitions, seed)
scA spark_connection.
sizeinteger(1). The number of deviates to generate.
num_partitionsinteger(1). Number of partitions in the RDD
(default: sc.defaultParallelism).
seedinteger(1). The seed to set.
A new Normal object which is a RDD[Double] comprised of
comprised of i.i.d. samples ~ N(0.0, 1.0)..
\dontrun{
sc <- sparklyr::spark_connect(master = "local")
norm <- Normal$new(
sc = sc,
size = 10L,
num_partitions = 1L,
seed = 1L
)
}
collect()Collect the random deviates into R.
Normal$collect()
\dontrun{
norm$collect()
}
count()Collect the random deviates into R.
Normal$count()
\dontrun{
norm$collect()
}
first()Count the number of deviates.
Normal$first()
\dontrun{
norm$count()
}
get_num_partitions()Get the number of partitions
Normal$get_num_partitions()
\dontrun{
norm$get_num_partitions()
}
clone()The objects of this class are cloneable with this method.
Normal$clone(deep = FALSE)
deepWhether to make a deep clone.
## ------------------------------------------------ ## Method `Normal$new` ## ------------------------------------------------ if (FALSE) { sc <- sparklyr::spark_connect(master = "local") norm <- Normal$new( sc = sc, size = 10L, num_partitions = 1L, seed = 1L ) } ## ------------------------------------------------ ## Method `Normal$collect` ## ------------------------------------------------ if (FALSE) { norm$collect() } ## ------------------------------------------------ ## Method `Normal$count` ## ------------------------------------------------ if (FALSE) { norm$collect() } ## ------------------------------------------------ ## Method `Normal$first` ## ------------------------------------------------ if (FALSE) { norm$count() } ## ------------------------------------------------ ## Method `Normal$get_num_partitions` ## ------------------------------------------------ if (FALSE) { norm$get_num_partitions() }