test-code/turf-working/turf2.R

#' Turf
#'
#' Does turf.
#'
#' @param data A data frame.
#' @param turf_cols Columns on which to run the TURF analysis.
#' @param case_weights An optional column of case weights.
#' @param k Set size. Can be any number of integers between 1 and number
#' of columns in `turf_cols`.
#' @param depth Number of items needed in order for a case to be considered
#' to be reached. Default is `1`.
#' @param min_reach Minimum individual reach (proportion) for an item to be
#' retained in the analysis. Can be any value between 0 and 1, default is `0`.
#' @param force_in Items in `turf_cols` that will be forced to be present in
#' every combination; this reduces the number of combinations.
#' @param mutually_exclude Items in `turf_cols` that cannot appear together in
#' a combination; this reduces the number of combinations.
#' @param greedy_begin The algorithm will run every combination of items up until the
#' set size controlled by this argument, after which a greedy algorithm will
#' kick in (controlled by `greedy_entry`). Default is `30`.
#' @param greedy_entry Two methods of selecting items from prior set size to
#' force into the next set size. Default is `"shapley"`.
#' \itemize{
#'   \item{`"shapley"`}{Selects according to highest approximated Shapley value}
#'   \item{`"reach"`}{Selects according to highest reach from prior set size}
#' }
#'
#' @md
#'
#' @export
turf <- function(
        data, turf_cols, case_weights,
        k, depth = 1,
        min_reach = 0, force_in, mutually_exclude,
        greedy_begin = 30, greedy_entry = "shapley"
) {



}
ttrodrigz/onezero documentation built on May 9, 2023, 2:59 p.m.