\name{randomIRanges} \alias{randomIRanges} \title{ Random IRanges} \description{ Create random IRanges } \usage{ randomIRanges(n, width, from, to, replace = TRUE) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{n}{ number of IRanges } \item{width}{ width for the IRanges } \item{from}{ starting index value for the sequence to be covered by IRanges } \item{to}{ ending index value for the sequence to be covered by IRanges } \item{replace}{ sampling with replacement if TRUE (see Details) } } \details{ The \code{from} and \code{to} parameters describe the underlying sequence to be covered by the ranges. To prevent having ranges outside the sequence, the \code{end} of the IRanges returned cannot be greater than \code{end} - \code{width}. If \code{replace} is \code{TRUE}, several IRanges can have the same starting value. } \value{ An \code{\link[IRanges:IRanges-class]{IRanges}} object of length \code{n}. } %\references{ ~put references to the literature/web site here ~ } %\author{ ~~who you are~~ } %\note{ ~~further notes~~ % % ~Make other sections like Warning with \section{Warning }{....} ~ %} \seealso{\code{\link[IRanges:IRanges-class]{IRanges}}} \examples{ n <- 10 rir <- randomIRanges(n, 5, 1, 33) # ASCII-art view reference <- paste("|", paste(rep("-", 33-2), collapse=""), "|", sep = "") regions <- vector("character", length=n) for (i in 1:n) { regions[i] <- paste( paste(rep(" ", start(rir)[i]), collapse=""), paste(rep("-", width(rir)[i]), collapse=""), sep = "" ) } cat(reference, regions, sep="\n") } % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \keyword{ manip }