R/contmeses.R

Defines functions contmeses

#' @title Contmeses
#'
#' @description Helpful function for identifying if a payment is required on that period.
#' @param x A numeric type value. The moment.
#' @param var A numeric type value. Number of payments per year.
#' @keywords Contmeses
#' @return Returns 1 if in that moment corresponds a payment or 0 if not.
#' @noRd
#'

contmeses<-function(x,var){
  j<-12/var
  if((x-1)/12==round((x-1)/12)){
    div<-1
  } else if(round((x-1)/j)==(x-1)/j){
    div<-1
  } else{
    div<-0
  }
  return(div)
}

Try the DetLifeInsurance package in your browser

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

DetLifeInsurance documentation built on Jan. 13, 2021, 11 a.m.