R/tf.R

Defines functions tf

Documented in tf

#' Touch-point Frequency Across Paths
#'
#' @param paths paths
#' @param touchpoint touchpoint
#' @return numeric vector

tf = function(paths, touchpoint){
  all_touchpoints = stringr::str_trim(unlist(stringr::str_split(paths, ">")))
  sum(touchpoint == all_touchpoints, na.rm = TRUE)
}
bdshaff/conversionpath documentation built on Dec. 19, 2021, 7:41 a.m.