R/driver_em_nested.R

Defines functions driver_em_nested

Documented in driver_em_nested

#' Analyse nested trajectory data
#' 
#' @param nest_traj Tibble containing the nested trajectory data with at least columns x, y
#' @param K Number of clusters to identify via the Expectation Maximization Algorithm
#' @importFrom magrittr %>%
#' @return Tibble containing results of the EM algorithm
#' @export

driver_em_nested <- function(nest_traj, K, P = 3){
  
  em_results <- nest_traj %>%
    tidyr::unnest(cols = c(x,y)) %>%
    cluster_trajectory_data(K = K, P = P)
  
  return(em_results)
}
danichusfu/RouteIdentification documentation built on March 22, 2021, 9:01 p.m.