Learn R Programming

flashlight (version 0.3.0)

midpoints: Midpoints

Description

Takes a vector of breaks and calculates midpoints of subsequent unique breaks.

Usage

midpoints(breaks)

Arguments

breaks

Numeric vector of cut points or a single number specifying the number of intervals desired.

Value

Vector of the same length as x minus 1 with midpoints of breaks.

Examples

Run this code
# NOT RUN {
midpoints(1:4)
midpoints(c(4, 4:1))
# }

Run the code above in your browser using DataLab