distribution: Create a 'Distribution' object.

Description Usage Arguments Value Author(s) See Also Examples

Description

The distribution function is a generic S4 method for creating a Distribution object.

Usage

1
distribution(x, precision = .Machine$double.eps, p.estimator = NA)

Arguments

x

A R object, see distribution-methods.

precision

A single numeric value. To be valid a Distribution object has to satisfy sum(object) == 1 +- precision.

p.estimator

Used only when x is a character or a factor. In this case p.estimator has to be function able to estimate probabilities, see for example p.estimator.laplace. A such function takes two arguments: y and weights, with y a character or a factor, and return a numeric.

Value

A Distribution object.

Author(s)

Emmanuel Rousseaux

See Also

Distribution, distribution.comparable, distribution.reorder.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
distribution(c(0.2,0.8))
data(iris)
distribution(iris$Species)

distribution(
  wvc(iris$Species, weights=c(rep(1,50), rep(0,100))),
  p.estimator = NA
)
distribution(
  wvc(iris$Species, weights=c(rep(1,50), rep(0,100))),
  p.estimator = p.estimator.laplace
)

trim documentation built on May 2, 2019, 5:36 p.m.