Learn R Programming

DNAprofiles (version 0.3.1)

dist.unique.events: Trim probability distribution to unique events with positive probability

Description

Trim probability distribution to unique events with positive probability

Usage

dist.unique.events(dist)

Arguments

dist
list with named numeric vectors x and fx, denoting respectively the events and probabilities of the discrete distribution.

Value

list with named numeric vectors x and fx, denoting respectively the events and probabilities of the discrete distribution.

Details

The function reduces x to the unique values and sums the corresponding elements from fx.

Examples

Run this code
dist.unique.events(list(x=c(0,1,1,2),fx=c(0.2,0.25,0.15,0.4)))

Run the code above in your browser using DataLab