R/combination_with_repetition.R

Defines functions combination_with_repetition

Documented in combination_with_repetition

#' @title Combination with repetition.
#' @description From combinatorial math, this function aims calculates combinations with repetitions.
#' @param n The number of elements (variables).
#' @param r The size of the groups (degreess of the polynomial interaction).
#' @export
combination_with_repetition <- function(n, r){
  factorial(r+n-1)/(factorial(n-1)*factorial(r))
} 

Try the estprod package in your browser

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

estprod documentation built on July 20, 2020, 5:07 p.m.