{
  "_id": "6a10357aacfb0bcc41c99abe",
  "Encoding": "UTF-8",
  "Package": "CADF",
  "Title": "Customer Analytics Data Formatting",
  "Version": "0.1",
  "Description": "Converts customer transaction data (ID, purchase date)\ninto a R6 class called customer.  The class stores various\ncustomer analytics calculations at the customer level. The\npackage also contains functionality to convert data in the R6\nclass to data.frames that can serve as inputs for various\ncustomer analytics models.",
  "License": "GPL-3",
  "LazyData": "true",
  "LazyDataCompression": "xz",
  "RoxygenNote": "7.3.1",
  "VignetteBuilder": "knitr",
  "Authors@R": "person(\"Ludwig\", \"Steven\", email = \"steven.ludwig@u.northwestern.edu\",\nrole = c(\"aut\", \"cre\"))",
  "Maintainer": "Ludwig Steven <steven.ludwig@u.northwestern.edu>",
  "NeedsCompilation": "no",
  "Packaged": {
    "Date": "2026-05-12 07:12:48 UTC",
    "User": "root"
  },
  "Author": "Ludwig Steven [aut, cre]",
  "Repository": "https://cran.r-universe.dev",
  "Date/Publication": "2024-10-31 14:10:02 UTC",
  "RemoteUrl": "https://github.com/cran/CADF",
  "RemoteRef": "HEAD",
  "RemoteSha": "6df76c2dbcfa567e6a81ef6a9c57213a35ccf2b6",
  "MD5sum": "621b96331ab5f4dc4b5bbfb5fbbbdf86",
  "_user": "cran",
  "_type": "src",
  "_file": "CADF_0.1.tar.gz",
  "_fileid": "39ff23c1d3d730ae63e761f25d6d30a03ff0ade082488bdd316e9c9b8b3441b9",
  "_filesize": 2940336,
  "_sha256": "39ff23c1d3d730ae63e761f25d6d30a03ff0ade082488bdd316e9c9b8b3441b9",
  "_created": "2026-05-12T07:12:48.000Z",
  "_published": "2026-05-22T10:52:42.209Z",
  "_distro": "noble",
  "_jobs": [
    {
      "job": 77365191826,
      "time": 164,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "NOTE",
      "artifact": "6937952628"
    },
    {
      "job": 77365191770,
      "time": 159,
      "config": "linux-release-x86_64",
      "r": "4.6.0",
      "check": "NOTE",
      "artifact": "6937949109"
    },
    {
      "job": 77365191848,
      "time": 299,
      "config": "source",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "6937900199"
    },
    {
      "job": 77365191303,
      "time": 132,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7158762124"
    }
  ],
  "_buildurl": "https://github.com/r-universe/cran/actions/runs/25719175563",
  "_status": "success",
  "_host": "GitHub-Actions",
  "_upstream": "https://github.com/cran/CADF",
  "_commit": {
    "id": "6df76c2dbcfa567e6a81ef6a9c57213a35ccf2b6",
    "author": "Ludwig Steven <steven.ludwig@u.northwestern.edu>",
    "committer": "cran-robot <csardi.gabor+cran@gmail.com>",
    "message": "version 0.1\n",
    "time": 1730383802
  },
  "_maintainer": {
    "name": "Ludwig Steven",
    "email": "steven.ludwig@u.northwestern.edu"
  },
  "_registered": true,
  "_dependencies": [
    {
      "package": "R",
      "version": ">= 3.5.0",
      "role": "Depends"
    },
    {
      "package": "R6",
      "role": "Imports"
    },
    {
      "package": "knitr",
      "role": "Suggests"
    },
    {
      "package": "rmarkdown",
      "role": "Suggests"
    },
    {
      "package": "lubridate",
      "role": "Suggests"
    },
    {
      "package": "markovchain",
      "role": "Suggests"
    },
    {
      "package": "utils",
      "role": "Suggests"
    },
    {
      "package": "survival",
      "role": "Suggests"
    }
  ],
  "_owner": "cran",
  "_selfowned": false,
  "_usedby": 0,
  "_updates": [],
  "_tags": [],
  "_stars": 0,
  "_userbio": {
    "uuid": 6899542,
    "type": "organization",
    "name": "cran",
    "description": "Unofficial read-only mirror of all CRAN R packages"
  },
  "_downloads": {
    "count": 595,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/CADF"
  },
  "_searchresults": 1,
  "_rbuild": "4.6.0",
  "_assets": [
    "extra/CADF.html",
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "manual.pdf"
  ],
  "_realowner": "cran",
  "_cranurl": false,
  "_releases": [
    {
      "version": "0.1",
      "date": "2024-10-31"
    }
  ],
  "_exports": [
    "annualhalfing_LL",
    "annualhalfingmodel",
    "bigT_expand_via_apply",
    "ca_SRM",
    "ca_SRM_time_varying",
    "ca_to_ps_matrix",
    "CADF_to_annualhalfing_data",
    "CADF_to_btyd_pareto_nbd",
    "CADF_to_logistic_regression",
    "CADF_to_migration_model",
    "CADF_to_nth_purchase",
    "CADF_to_nth_purchase_allrows",
    "create.purchase.string",
    "create.recency.string",
    "Customer",
    "f_CustomerModelingMatrix",
    "f_CustomerSurvivalModelingMatrix",
    "frequency_from_ps",
    "frequency_from_rle",
    "generate_date_template",
    "id_to_CADF",
    "ld_sample_customer_matrix",
    "modeling.annualhalfing.likelihood",
    "modeling.LL.gamma_spend",
    "pdf_gamma",
    "pdf_gamma2",
    "print.glossary",
    "ps_to_T_custom",
    "ps_to_T_strict_quitter",
    "ps_to_T_strict_stayer",
    "psmatrix_to_recency_attimeof_matrix",
    "qc_transactional_data",
    "simple_migration",
    "split.transaction.file_to_CADF",
    "transitions"
  ],
  "_datasets": [
    {
      "name": "bass.answeringmachines",
      "title": "Answering machine data",
      "object": "answeringmachines",
      "class": [
        "data.frame"
      ],
      "fields": [
        "year",
        "sales"
      ],
      "rows": 9,
      "table": true,
      "tojson": true
    },
    {
      "name": "billionaire",
      "title": "Billionaires",
      "object": "health",
      "class": [
        "data.frame"
      ],
      "fields": [
        "X",
        "X.1",
        "Probability.....of.dying.between.age.30.and.exact.age.70.from.any.of.cardiovascular.disease..cancer..diabetes..or.chronic.respiratory.disease",
        "Probability.....of.dying.between.age.30.and.exact.age.70.from.any.of.cardiovascular.disease..cancer..diabetes..or.chronic.respiratory.disease.1",
        "Probability.....of.dying.between.age.30.and.exact.age.70.from.any.of.cardiovascular.disease..cancer..diabetes..or.chronic.respiratory.disease.2",
        "Crude.suicide.rates..per.100.000.population.",
        "Crude.suicide.rates..per.100.000.population..1",
        "Crude.suicide.rates..per.100.000.population..2"
      ],
      "rows": 3661,
      "table": true,
      "tojson": true
    },
    {
      "name": "cadf.data.sample",
      "title": "CADF-formatted sample data",
      "object": "cadf.sample.data",
      "class": [
        "list"
      ],
      "fields": [],
      "table": false,
      "tojson": false
    },
    {
      "name": "discretechoice",
      "title": "Discrete choice",
      "object": "discretechoice",
      "class": [
        "data.frame"
      ],
      "fields": [
        "y",
        "x"
      ],
      "rows": 100,
      "table": true,
      "tojson": true
    },
    {
      "name": "exceldata",
      "title": "Excel data",
      "object": "exceldata",
      "class": [
        "data.frame"
      ],
      "fields": [
        "A",
        "B",
        "C",
        "D",
        "E",
        "F",
        "G",
        "H",
        "I"
      ],
      "rows": 50,
      "table": true,
      "tojson": true
    },
    {
      "name": "fp",
      "title": "Health Data",
      "object": "fp",
      "class": [
        "data.frame"
      ],
      "fields": [
        "country",
        "ccode",
        "year",
        "cyear",
        "numbil",
        "numbil0",
        "numbilall",
        "netw",
        "netw0",
        "netwall",
        "gdpcurdol",
        "gdpbill",
        "pop",
        "lnpop",
        "gdppc",
        "lngdp",
        "lngdppc",
        "d7netwall",
        "d7numbilall",
        "lowinc08",
        "midinc08",
        "totppb9008",
        "privprocbarb",
        "fullprivproc",
        "wtoyear",
        "gattwto",
        "gattwto08",
        "mcapbdol",
        "mcapbdol08",
        "lnmcap08",
        "topintaxnew",
        "topint08",
        "rintr",
        "noyrs",
        "roflaw",
        "nrrents"
      ],
      "rows": 5432,
      "table": true,
      "tojson": true
    },
    {
      "name": "gammagamma",
      "title": "Gamma gamma spend model data",
      "object": "gammagamma",
      "class": [
        "data.frame"
      ],
      "fields": [
        "ID",
        "x",
        "t_x",
        "T",
        "zbar"
      ],
      "rows": 2357,
      "table": true,
      "tojson": true
    },
    {
      "name": "ltv.transactions",
      "title": "LTV transactions data",
      "object": "ltv.transactions",
      "class": [
        "data.frame"
      ],
      "fields": [
        "ID",
        "PURCHASE_DATE",
        "NUM_ITEMS",
        "TOTAL"
      ],
      "rows": 53998,
      "table": true,
      "tojson": true
    },
    {
      "name": "segltv",
      "title": "Segmentation and LTV data",
      "object": "segltv",
      "class": [
        "data.frame"
      ],
      "fields": [
        "ID",
        "PURCHASE_DATE",
        "NUM_ITEMS",
        "TOTAL"
      ],
      "rows": 53998,
      "table": true,
      "tojson": true
    },
    {
      "name": "srm_data",
      "title": "#' Simple retention model data",
      "object": "srm_data",
      "class": [
        "data.frame"
      ],
      "fields": [
        "bigT",
        "cancel"
      ],
      "rows": 5828,
      "table": true,
      "tojson": true
    },
    {
      "name": "srm_summaries",
      "title": "SRM model data",
      "object": "srm_summaries",
      "class": [
        "data.frame"
      ],
      "fields": [
        "bigT",
        "cancel",
        "count"
      ],
      "rows": 22,
      "table": true,
      "tojson": true
    },
    {
      "name": "stocks",
      "title": "Stockmarket put/call data",
      "object": "stocks_putcall",
      "class": [
        "data.frame"
      ],
      "fields": [
        "CPCE.Date",
        "CPCE.Value",
        "CPCE.Sent",
        "NextBusinessDay",
        "QQQ_Open",
        "QQQ_High",
        "QQQ_Low",
        "QQQ_Close",
        "QQQ_Volume",
        "QQQ_Adjusted",
        "QQQ_Indicator",
        "QQQ_Date",
        "SPY_Open",
        "SPY_High",
        "SPY_Low",
        "SPY_Close",
        "SPY_Volume",
        "SPY_Adjusted",
        "SPY_Indicator",
        "SPY_Date"
      ],
      "rows": 770,
      "table": true,
      "tojson": true
    },
    {
      "name": "transactions",
      "title": "Transactions data",
      "object": "transactions",
      "class": [
        "data.frame"
      ],
      "fields": [
        "ID",
        "PURCHASE_DATE",
        "NUM_ITEMS",
        "TOTAL"
      ],
      "rows": 69659,
      "table": true,
      "tojson": true
    },
    {
      "name": "transactions.merged",
      "title": "#' Transaction data",
      "object": "transactions.merged",
      "class": [
        "data.frame"
      ],
      "fields": [
        "ID",
        "PURCHASE_DATE",
        "NUM_ITEMS",
        "TOTAL"
      ],
      "rows": 68194,
      "table": true,
      "tojson": true
    }
  ],
  "_help": [
    {
      "page": "annualhalfing_LL",
      "title": "Likelihood maximization for annual halfing customer retention model",
      "topics": [
        "annualhalfing_LL"
      ]
    },
    {
      "page": "annualhalfingmodel",
      "title": "Annual Halfing Model",
      "topics": [
        "annualhalfingmodel"
      ]
    },
    {
      "page": "bass.answeringmachines",
      "title": "Answering machine data",
      "topics": [
        "bass.answeringmachines"
      ]
    },
    {
      "page": "bigT_expand_via_apply",
      "title": "bigT_expand_via_apply",
      "topics": [
        "bigT_expand_via_apply"
      ]
    },
    {
      "page": "billionaire",
      "title": "Billionaires",
      "topics": [
        "billionaire"
      ]
    },
    {
      "page": "ca_SRM",
      "title": "ca_SRM",
      "topics": [
        "ca_SRM"
      ]
    },
    {
      "page": "ca_SRM_time_varying",
      "title": "Time varying Simple retention model Estimates retention rate using logistic regression and the simple regression model Mostly used for contractual models where there are clear opportunities for cancellation.  Could be used in non-contractional situations although the cancellation opportunities should be defined.  Not recommended for use with services that consumers use rotating-door style.  Use the migration model there.",
      "topics": [
        "ca_SRM_time_varying"
      ]
    },
    {
      "page": "ca_to_ps_matrix",
      "title": "CADF to purchase string Extracts purchase strings from the CADF and formats as a R matrix.",
      "topics": [
        "ca_to_ps_matrix"
      ]
    },
    {
      "page": "cadf",
      "title": "cadf.",
      "topics": [
        "cadf"
      ]
    },
    {
      "page": "CADF_to_annualhalfing_data",
      "title": "Convert CADF dataset into annualhalfing model dataset",
      "topics": [
        "CADF_to_annualhalfing_data"
      ]
    },
    {
      "page": "CADF_to_btyd_pareto_nbd",
      "title": "CADF to btyd pareto nbd model",
      "topics": [
        "CADF_to_btyd_pareto_nbd"
      ]
    },
    {
      "page": "CADF_to_logistic_regression",
      "title": "CADF to logistic regression",
      "topics": [
        "CADF_to_logistic_regression"
      ]
    },
    {
      "page": "CADF_to_migration_model",
      "title": "CADF_to_migration_model converts CADF data to migration model data",
      "topics": [
        "CADF_to_migration_model"
      ]
    },
    {
      "page": "CADF_to_nth_purchase",
      "title": "CADF_to_nth_purchase",
      "topics": [
        "CADF_to_nth_purchase"
      ]
    },
    {
      "page": "CADF_to_nth_purchase_allrows",
      "title": "CADF_to_nth_purchase_allrows inputs CADF data and the desired purchase number that you want to count the nth result of.",
      "topics": [
        "CADF_to_nth_purchase_allrows"
      ]
    },
    {
      "page": "cadf.data.sample",
      "title": "CADF-formatted sample data",
      "topics": [
        "cadf.data.sample"
      ]
    },
    {
      "page": "create.purchase.string",
      "title": "Function called during Customer$new() (the Customer R6 class) to create purchase string for the customer.",
      "topics": [
        "create.purchase.string"
      ]
    },
    {
      "page": "create.recency.string",
      "title": "create_recency_string",
      "topics": [
        "create.recency.string"
      ]
    },
    {
      "page": "Customer",
      "title": "R6 Class representing a customer.  Otherwise known as the CADF.",
      "topics": [
        "Customer"
      ]
    },
    {
      "page": "discretechoice",
      "title": "Discrete choice",
      "topics": [
        "discretechoice"
      ]
    },
    {
      "page": "exceldata",
      "title": "Excel data",
      "topics": [
        "exceldata"
      ]
    },
    {
      "page": "f_CustomerModelingMatrix",
      "title": "For each customer, return a modeling matrix that is utilized for logistic regression",
      "topics": [
        "f_CustomerModelingMatrix"
      ]
    },
    {
      "page": "f_CustomerSurvivalModelingMatrix",
      "title": "For each customer, return a survival modeling matrix that is utilized for survival analysis",
      "topics": [
        "f_CustomerSurvivalModelingMatrix"
      ]
    },
    {
      "page": "f_intMonths",
      "title": "Compute the months between two purchase dates",
      "topics": [
        "f_intMonths"
      ]
    },
    {
      "page": "fp",
      "title": "Health Data",
      "topics": [
        "fp"
      ]
    },
    {
      "page": "frequency_from_ps",
      "title": "Purchase string to frequency count",
      "topics": [
        "frequency_from_ps"
      ]
    },
    {
      "page": "frequency_from_rle",
      "title": "RLE object to frequency count",
      "topics": [
        "frequency_from_rle"
      ]
    },
    {
      "page": "gammagamma",
      "title": "Gamma gamma spend model data",
      "topics": [
        "gammagamma"
      ]
    },
    {
      "page": "generate_date_template",
      "title": "generate_date_template",
      "topics": [
        "generate_date_template"
      ]
    },
    {
      "page": "id_to_CADF",
      "title": "Convert to CADF for a single customer id",
      "topics": [
        "id_to_CADF"
      ]
    },
    {
      "page": "ld_sample_customer_matrix",
      "title": "LD functions are utilized for learning and diagnostic use.",
      "topics": [
        "ld_sample_customer_matrix"
      ]
    },
    {
      "page": "ltv.transactions",
      "title": "LTV transactions data",
      "topics": [
        "ltv.transactions"
      ]
    },
    {
      "page": "modeling.annualhalfing.likelihood",
      "title": "Likelihood function for annual halfing model",
      "topics": [
        "modeling.annualhalfing.likelihood"
      ]
    },
    {
      "page": "modeling.LL.gamma_spend",
      "title": "LL function for the gamma gamma spend model",
      "topics": [
        "modeling.LL.gamma_spend"
      ]
    },
    {
      "page": "pdf_gamma",
      "title": "PDF probability function for gamma distribution",
      "topics": [
        "pdf_gamma"
      ]
    },
    {
      "page": "pdf_gamma2",
      "title": "Probability density function for gamma distribution",
      "topics": [
        "pdf_gamma2"
      ]
    },
    {
      "page": "print.glossary",
      "title": "The glossary for the CADF data format",
      "topics": [
        "print.glossary"
      ]
    },
    {
      "page": "ps_to_T_custom",
      "title": "Calculates T from a purchase string.  Custom.",
      "topics": [
        "ps_to_T_custom"
      ]
    },
    {
      "page": "ps_to_T_strict_quitter",
      "title": "Calculates T from a purchase string",
      "topics": [
        "ps_to_T_strict_quitter"
      ]
    },
    {
      "page": "ps_to_T_strict_stayer",
      "title": "Calculates T from a purchase string under the \"strict stayer\" assumption.",
      "topics": [
        "ps_to_T_strict_stayer"
      ]
    },
    {
      "page": "psmatrix_to_psstring",
      "title": "psmatrix_to_psstring",
      "topics": [
        "psmatrix_to_psstring"
      ]
    },
    {
      "page": "psmatrix_to_recency_attimeof_matrix",
      "title": "accepts a psmatrix converts 1/0 purchase strings to recency at timeof",
      "topics": [
        "psmatrix_to_recency_attimeof_matrix"
      ]
    },
    {
      "page": "qc_transactional_data",
      "title": "The customer analytics data format (CADF) relays heavily on correct input data. Transactional data must: 1.) be a data frame with two columns 2.) Column one is the customer id 3.) Column 2 is the transaction date.  Column 2 must be formatted as a date object in R.",
      "topics": [
        "qc_transactional_data"
      ]
    },
    {
      "page": "segltv",
      "title": "Segmentation and LTV data",
      "topics": [
        "segltv"
      ]
    },
    {
      "page": "simple_migration",
      "title": "Simple Migration",
      "topics": [
        "simple_migration"
      ]
    },
    {
      "page": "split.transaction.file_to_CADF",
      "title": "Create a CADF dataset from a dataframe",
      "topics": [
        "split.transaction.file_to_CADF"
      ]
    },
    {
      "page": "srm_data",
      "title": "#' Simple retention model data",
      "topics": [
        "srm_data"
      ]
    },
    {
      "page": "srm_summaries",
      "title": "SRM model data",
      "topics": [
        "srm_summaries"
      ]
    },
    {
      "page": "stocks",
      "title": "Stockmarket put/call data",
      "topics": [
        "stocks"
      ]
    },
    {
      "page": "transactions",
      "title": "Transactions data",
      "topics": [
        "transactions"
      ]
    },
    {
      "page": "transactions.merged",
      "title": "#' Transaction data",
      "topics": [
        "transactions.merged"
      ]
    },
    {
      "page": "transitions",
      "title": "Calculate transition periods between two timeperiods",
      "topics": [
        "transitions"
      ]
    }
  ],
  "_rundeps": [
    "R6"
  ],
  "_vignettes": [
    {
      "source": "my-vignette.Rmd",
      "filename": "my-vignette.html",
      "title": "Using CADF to Prepare Customer Analytic Datasets",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Introduction",
        "Process",
        "How it Works",
        "(1) Split Transactional Data by Customer ID",
        "(2) Apply - process the data",
        "(3A) Recombine the data for Interesting Statistical Analysis",
        "Getting Customers' nth Purchase",
        "Purchase Strings",
        "(3B)Creating Analytic Datasets for Situations Where Cancellation is Clear",
        "Simple Retention Model - Example from SAS book",
        "Estimating Retention Rate",
        "Estimating Retention using Survival Analysis",
        "Logistic Regression: Discrete Time Survival Model",
        "Simple Retention Model Using CADF",
        "Create dataset for annual halfing model",
        "(3C) Creating Analytic Datasets for Situations Where Cancellation is Not Clear",
        "Create dataset for migration model",
        "License and Usage"
      ],
      "created": "2024-10-31 14:10:02",
      "modified": "2024-10-31 14:10:02",
      "commits": 1
    }
  ],
  "_score": 2,
  "_indexed": true,
  "_nocasepkg": "cadf",
  "_universes": [
    "cran"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "0.1",
      "date": "2026-05-12T07:15:35.000Z",
      "distro": "noble",
      "commit": "6df76c2dbcfa567e6a81ef6a9c57213a35ccf2b6",
      "fileid": "4cab447315bca04317732d5f7b7d2f2a70e2dfb96cc510c4e7ce693e9d7d78de",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/cran/actions/runs/25719175563"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "0.1",
      "date": "2026-05-12T07:15:25.000Z",
      "distro": "noble",
      "commit": "6df76c2dbcfa567e6a81ef6a9c57213a35ccf2b6",
      "fileid": "9913219dfc03c0fcb053a06a3832d3087828b824dc90d437b685872ffb1c9f77",
      "status": "success",
      "check": "NOTE",
      "buildurl": "https://github.com/r-universe/cran/actions/runs/25719175563"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "0.1",
      "date": "2026-05-22T10:51:57.000Z",
      "commit": "6df76c2dbcfa567e6a81ef6a9c57213a35ccf2b6",
      "fileid": "54b92c7c14ba47fecf5110e282873d7fc4af5afdea943f377948c7a60b615071",
      "status": "success",
      "buildurl": "https://github.com/r-universe/cran/actions/runs/25719175563"
    }
  ]
}