GetStartEndIndices: Indices of Continuous Subsequences of Certain Value

Description Usage Arguments Value Examples

View source: R/GetStartEndIndices.R

Description

Give all start and end indices of continuous subsequeces of value inside vector x

Usage

1

Arguments

x

a vector of any given length and mode, e.g. "logical", "integer", "numeric" etc, from which to find the index of value

value

an element to search for

Value

A list of two vectors

Examples

1
2
3
4
5
6
x <- c(T, T)
GetStartEndIndices(x, T)
x <- c(F, F, T, F, T, T, T, F)
GetStartEndIndices(x, T)
x <- c(1, 1, 2, 3, 4, 1, 1, 1)
GetStartEndIndices(x, 1)

jingjin1018/anetimeseries documentation built on May 19, 2019, 10:35 a.m.