get_segs: Divide a bullet signature/profile into basis segments of...

View source: R/segment.R

get_segsR Documentation

Divide a bullet signature/profile into basis segments of desired length

Description

get_segs divides a bullet signature/profile (a numeric vector) into consecutive, non-overlapping, basis segments of the same desired length. If the profile starts or ends with a sequence of NA (missing values), the NAs will be trimmed. If the very last segment does not have the desired length, it will be dropped.

Usage

get_segs(x, len = 50)

Arguments

x

a numeric vector, vector of the bullet signature/profile

len

integer: the desired length of a basis segment

Value

list with basis segments and their corresponding indices in the profile

Examples

data("bullets")
land2_3 <- bullets$sigs[bullets$bulletland == "2-3"][[1]]
x <- land2_3$sig

segments <- get_segs(x, len = 50)

cmpsR documentation built on July 18, 2022, 9:07 a.m.