R/poly_elements.R

Defines functions poly_elements

Documented in poly_elements

#' @title Number of \code{poly} elements.
#' @description This function aims calculate the number of terms of a polynomial interactions.
#' @param n The number of variables.
#' @param d Degreess of polynomial interaction.
#' @export
poly_elements <- function(n, d) {
  x <- sapply(1:d, combination_with_repetition, n = n) 
  return(sum(x))
}

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.