ts_duration | R Documentation |
Time series to Duration series
ts_duration(
y,
timeVec = stats::time(y),
fs = stats::frequency(y),
tolerance = 0
)
y |
A time series, numeric vector, or categorical variable. |
timeVec |
A vector, same length as |
fs |
Optional sampling frequency if timeVec represents sample indices. An extra column |
tolerance |
A number |
A data frame
Other Time series operations:
ts_center()
,
ts_changeindex()
,
ts_checkfix()
,
ts_detrend()
,
ts_diff()
,
ts_discrete()
,
ts_embed()
,
ts_integrate()
,
ts_levels()
,
ts_peaks()
,
ts_permtest_block()
,
ts_permtest_transmat()
,
ts_rasterize()
,
ts_sd()
,
ts_slice()
,
ts_slopes()
,
ts_standardise()
,
ts_sumorder()
,
ts_symbolic()
,
ts_trimfill()
,
ts_windower()
library(invctr)
# Create data with events and their timecodes
coder <- data.frame(beh=c("stare","stare","coffee","type","type","stare"),t=c(0,5,10,15,20,25))
ts_duration(y = coder$beh, timeVec = coder$t)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.