Learn R Programming

rankUncertainty (version 1.0.2.0)

generateIntervals: Generate random intervals

Description

Generate a set of intervals with endpoints uniformly distributed between 0 and 1.

Usage

generateIntervals(n, sort = FALSE, f = NULL)

Arguments

n

number of intervals to generate

sort

if TRUE, sort the output intervals by their left endpoints

f

transformation to apply to each endpoint

Value

Data frame with columns 'left' and 'right'. It is guaranteed that every value in 'left' is no greater than the corresponding value in 'right'.

Examples

Run this code
# NOT RUN {
generateIntervals(10)
generateIntervals(20, f = qnorm)
generateIntervals(5, TRUE, f = function(x) { x + 1 })

# }

Run the code above in your browser using DataLab