bayesmove (version 0.1.0)

summarize_tsegs: Summarize observations within bins per track segment

Description

Prepares the data that has already been segmented for clustering by Latent Dirichlet Allocation. This function summarizes the counts observed per movement variable bin within each track segment per animal ID.

Usage

summarize_tsegs(dat, nbins)

Arguments

dat

A data frame of only the animal ID, track segment number, and the discretized data for each movement variable. Animal ID and time segment must be the first two columns of this data frame. This should be a simplified form of the output from assign_tseg.

nbins

numeric. A vector of the number of bins used to discretize each movement variable. These must be in the same order as the columns within dat.

Value

A new data frame that contains the animal ID, track segment number, and the counts per bin for each movement variable. The names for each of these bins are labeled according to the order in which the variables were provided to summarize_tsegs.

Examples

Run this code
# NOT RUN {
#load data
data(tracks.seg)

#select only id, tseg, SL, and TA columns
tracks.seg2<- tracks.seg[,c("id","tseg","SL","TA")]

#run function
obs<- summarize_tsegs(dat = tracks.seg2, nbins = c(5,8))


# }

Run the code above in your browser using DataCamp Workspace