Generate random deviates from an exponential distribution
Generate random deviates from an exponential distribution
new()Create a new Exponential object.
Exponential$new(sc, mean, size, num_partitions, seed)
scA spark_connection.
meaninteger(1). The mean (1 / lambda) for the exponential
distribution.
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 Exponential object which is a RDD[Double] comprised of
comprised of i.i.d. samples ~ Exp(mean)..
\dontrun{
sc <- sparklyr::spark_connect(master = "local")
exp <- Exponential$new(
sc = sc,
mean = 2,
size = 10L,
num_partitions = 1L,
seed = 1L
)
}
collect()Collect the random deviates into R.
Exponential$collect()
\dontrun{
exp$collect()
}
count()Collect the random deviates into R.
Exponential$count()
\dontrun{
exp$collect()
}
first()Count the number of deviates.
Exponential$first()
\dontrun{
exp$count()
}
get_num_partitions()Get the number of partitions
Exponential$get_num_partitions()
\dontrun{
exp$get_num_partitions()
}
clone()The objects of this class are cloneable with this method.
Exponential$clone(deep = FALSE)
deepWhether to make a deep clone.
## ------------------------------------------------ ## Method `Exponential$new` ## ------------------------------------------------ if (FALSE) { sc <- sparklyr::spark_connect(master = "local") exp <- Exponential$new( sc = sc, mean = 2, size = 10L, num_partitions = 1L, seed = 1L ) } ## ------------------------------------------------ ## Method `Exponential$collect` ## ------------------------------------------------ if (FALSE) { exp$collect() } ## ------------------------------------------------ ## Method `Exponential$count` ## ------------------------------------------------ if (FALSE) { exp$collect() } ## ------------------------------------------------ ## Method `Exponential$first` ## ------------------------------------------------ if (FALSE) { exp$count() } ## ------------------------------------------------ ## Method `Exponential$get_num_partitions` ## ------------------------------------------------ if (FALSE) { exp$get_num_partitions() }