Remove duplicated consecutive states from data. If for an individual there is two or more consecutive states that are identical, only the first is kept. Only time when the state changes are kept.
remove_duplicated_states(data, keep.last = TRUE)
data.frame containing id
, id of the trajectory, time
, time at which a change occurs
and state
, associated state.
if TRUE, keep the last state for every individual even if it is a duplicated state.
data
without duplicated consecutive states
Other format:
convertToCfd()
,
cut_data()
,
matrixToCfd()