Learn R Programming

vectools (version 0.2.0)

43_other_sequence_functions: Other Sequence Functions

Description

Compute midpoints and endpoints from a vector.

Usage

midpoints (x)
endpoints (x)

Arguments

x

An integer/numeric vector.

Value

The midpoints function returns a vector, with a length one less than the original vector.

The endpoints function returns a length two vector.

See Also

Unique-Related Functions

Sequence Properties (Other than unique-related properties).

Optimization-Related Functions

Examples

Run this code
# NOT RUN {
x <- 1:4

midpoints (x)
endpoints (x)
# }

Run the code above in your browser using DataLab