breaks: breaks

View source: R/breaks.R

breaksR Documentation

breaks

Description

Creates a number of equidistant or non-equidistant breaks for given data x. If width is not given then it will be set to diff(pretty(x))[1]. probs can either be a single integer giving the number of quantiles or a vector of probabilities with values in [0,1]. Note that if width is too large then using probs may result in equidistant breaks, too.

Usage

breaks(x, width = NULL, probs = NULL)

Arguments

x

numeric: data

width

numeric: class width (default: NULL)

probs

numeric: number of non-equidistant classes (default: NULL)

Value

a numeric vector of breaks

Examples

x <- rnorm(100, mean=1.8, sd=0.1)
breaks(x)
breaks(x, 0.1)
breaks(x, 0.1, probs=4)

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