stagevec: Convenience function for building a vector for dive stages

Description Usage Arguments Details Examples

View source: R/stagevec.R

Description

Several functions in the dsdive package have a record of dive stages as one of the function's arguments. However, this information is not always available. For example, dive stage information is a latent variable so is not included with observational data.

Usage

1
stagevec(length.out, breaks)

Arguments

length.out

Length of vector to generate

breaks

Location of changepoints

Details

The stagevec function makes it easy to generate a vector of dive stages, like c(1,1,1,2,2,2,2,3,3). Users only need to provide a target length length.out and the indices at which the stage changes breaks.

Examples

1
stagevec(length.out = 30, breaks = c(7, 20))

jmhewitt/dsdive documentation built on May 29, 2020, 5:18 p.m.