Learn R Programming

not (version 1.0)

random.intervals: Generate random intervals

Description

The function generates M intervals of the length smaller or equal than max.length, whose endpoints are are drawn uniformly without replacements from 1,2,..., n. This routine can be used inside not function and is typically not called directly by the user.

Usage

random.intervals(n, M, max.length = n, ...)

Arguments

n

a number of endpoints to choose from

M

a number of intervals to generate

max.length

an integer specifying maximum interval length

...

not in use

Value

a M by 2 matrix with start (first column) and end (second column) points of an interval in each row

See Also

not

Examples

Run this code
# NOT RUN {
#*** draw 100 intervals with the endpoints in 1,...,100
intervals <- random.intervals(50, 100)
# }

Run the code above in your browser using DataLab