histbreaks: histbreaks

View source: R/histbreaks.R

histbreaksR Documentation

histbreaks

Description

Select randomly size breakpoints from breaks. If outer is TRUE then the first and last element of breaks is always included into the returned break points. If size is a vector then first the number of breakpoints is sampled from size.

Usage

histbreaks(breaks, size, outer = TRUE, ...)

Arguments

breaks

numeric: a vector of possible break points

size

integer: number of break points

outer

logical: should be the first and last element of breaks included (default: TRUE)

...

further parameters given if sampling of size is necessary, see base::sample

Value

a vector of breakpoints

Examples

# includes always 100 and 200
histbreaks(seq(100, 200, by=10), 4)
# includes always 100 and 200 and chooses randomly between 3 to 5 bareak points  
histbreaks(seq(100, 200, by=10), 3:5)           
# may not include include 100 and 200
histbreaks(seq(100, 200, by=10), 4, outer=FALSE) 

sigbertklinke/exams2moodle documentation built on July 6, 2023, 3:26 p.m.