assign_tseg_internal: Internal function that adds segment numbers to observations

Description Usage Arguments Value

View source: R/segmentation_helper_functions.R

Description

After breakpoints have been extracted for each animal ID, this function assigns the associated segment number to observations for each animal ID. These segments of observations will be used in the second stage of the model framework to perform mixed-membership clustering by Latent Dirichlet Allocation.

Usage

1
assign_tseg_internal(dat, brkpts)

Arguments

dat

A data frame that contains all data associated for a given animal ID. Must include a column labeled time1 that numbers each of the observations in consecutive order, which is automatically generated by filter_time.

brkpts

A data frame of breakpoints for each animal ID (as generated by get_breakpts).

Value

A data frame that updates the original data object by including the segment number associated with each observation in relation to the extracted breakpoints.


bayesmove documentation built on Oct. 22, 2021, 9:08 a.m.