R/cpmReset.R

Defines functions cpmReset

Documented in cpmReset

cpmReset <- function(cpm) {
    #Lepage is handed separately since both its component CPMS must
    #be reset
    if (class(cpm) == "ChangePointModelLepage") {
        return(cpmResetLepage(cpm))
    }
    
    cpm@n <- 0
    cpm@changeDetected <- FALSE
    for (i in 1:length(cpm@windowStatistic)) {
        cpm@windowStatistic[[i]] <- numeric()
    }
    
  return(cpm)
}

Try the cpm package in your browser

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

cpm documentation built on Nov. 16, 2020, 9:13 a.m.