odd_wsize: Check the oddity of the window

Description Usage Arguments Note Author(s) Examples

Description

This function checks if the size of the window provided is odd. If not, it gives a warning and it returns a window size equal to the first odd integer contained in the provided size.

Usage

1
odd_wsize(wsize)

Arguments

wsize

Note

Observations and bug segnalations are welcome.

Author(s)

Eugenio Thieme, eugen@thieme.it

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (wsize) 
{
    if (wsize%%2 == 0) {
        warning("Even window size! Size will be coerced to first odd integer contained in the actual size.")
        wsize <- (wsize - 1)
    }
    return(wsize)
  }

theugen/moving_window documentation built on May 31, 2019, 9:51 a.m.