Generate random deviates from a normal distribution

Generate random deviates from a normal distribution

Methods

Public methods


Method new()

Create a new Normal object.

Usage

Normal$new(sc, size, num_partitions, seed)

Arguments

sc

A spark_connection.

size

integer(1). The number of deviates to generate.

num_partitions

integer(1). Number of partitions in the RDD (default: sc.defaultParallelism).

seed

integer(1). The seed to set.

Returns

A new Normal object which is a RDD[Double] comprised of comprised of i.i.d. samples ~ N(0.0, 1.0)..

Examples

\dontrun{
  sc <- sparklyr::spark_connect(master = "local")
  norm <- Normal$new(
    sc = sc,
    size = 10L,
    num_partitions = 1L,
    seed = 1L
  )
}


Method collect()

Collect the random deviates into R.

Usage

Normal$collect()

Examples

\dontrun{
  norm$collect()
}


Method count()

Collect the random deviates into R.

Usage

Normal$count()

Examples

\dontrun{
  norm$collect()
}


Method first()

Count the number of deviates.

Usage

Normal$first()

Examples

\dontrun{
  norm$count()
}


Method get_num_partitions()

Get the number of partitions

Usage

Normal$get_num_partitions()

Examples

\dontrun{
  norm$get_num_partitions()
}


Method clone()

The objects of this class are cloneable with this method.

Usage

Normal$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

## ------------------------------------------------ ## 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() }