R/CADF_to_nth_purchase.R

Defines functions CADF_to_nth_purchase

Documented in CADF_to_nth_purchase

#' @title CADF_to_nth_purchase

#' @param n the nth purchase you want to analyze
#' @param cadf.data  Data in R list format processed by CADF functions


#' @export CADF_to_nth_purchase
CADF_to_nth_purchase <- function(cadf.data, n) {                                                                   
  #extract the nth purchase
  rows_for_analysis <- lapply(cadf.data, function(x) x$data[x$data$purchase.num == n,])
  rows_for_analysis2 <- do.call(rbind, rows_for_analysis)
  rows_for_analysis3 <- rows_for_analysis2$Tweeks
}

Try the CADF package in your browser

Any scripts or data that you put into this service are public.

CADF documentation built on Oct. 31, 2024, 5:08 p.m.