Description Usage Arguments Value Examples
View source: R/LDA_helper_functions.R
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.
1 | summarize_tsegs(dat, nbins)
|
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 |
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
|
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
.
1 2 3 4 5 6 7 8 | #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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.