Learn R Programming

splinetrials (version 0.1.1)

midpoints: Midpoints of a Numeric Vector

Description

Returns the midpoints between the elements of a vector in the order the elements appear.

Usage

midpoints(x)

Value

A numeric vector of length

length(x) - 1.

Arguments

x

A numeric vector with at least 2 elements.

Details

This function does not sort.

Examples

Run this code
midpoints(c(0, 1, 10, 4))

Run the code above in your browser using DataLab