Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

find_breaks

Breakpoints to be passed to a Histogram


Description

The function find_breaks() isolates a piece of code of the function truehist() from package MASS that is used to compute the set of breakpoints to be applied for the construction of the histogram.

Usage

find_breaks(x, nbins = "Scott", h, x0 = -h/1000)

Arguments

x

numeric. A vector.

nbins

integer or character. The suggested number of bins. Either a positive integer, or a character string naming a rule: "Scott" (the default) or "Freedman-Diaconis" or "FD". (Case is ignored.)

h

numeric. The bin width, a strictly positive number (takes precedence over nbins).

x0

numeric. Shift for the bins - the breaks are at x0 + h * (..., -1, 0, 1, ...).

Value

A numeric vector.

See Also

histo() in this package; truehist() from package MASS; hist() from package graphics.


statip

Statistical Functions for Probability Distributions and Regression

v0.2.3
GPL-3
Authors
Paul Poncet [aut, cre], The R Core Team [aut, cph] (C function 'BinDist' copied from package 'stats'), The R Foundation [cph] (C function 'BinDist' copied from package 'stats'), Adrian Baddeley [ctb] (C function 'BinDist' copied from package 'stats')
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.