Learn R Programming

vectools (version 0.3.0)

55_sequence_properties_2: Other Sequence Properties

Description

Compute midpoints and endpoints from a vector.

Usage

midpoints (v)
endpoints (v)

Arguments

v

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