R/various_code.R

Defines functions .onAttach Kernel_uni Kernel_tri is_even

### MISC
is_even <- function(a) {
    a%%2 == 0
}


Kernel_tri <- function(X, center, bw) {
    ifelse(abs(X - center) > bw, 0, 1 - (abs(X - center)/bw))
}

Kernel_uni <- function(X, center, bw) {
    ifelse(abs(X - center) > bw, 0, 1)
}

.onAttach <- function(...) {
  packageStartupMessage('
Please consider citing R and rddtools,
citation()
citation("rddtools")
')}

Try the rddtools package in your browser

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

rddtools documentation built on Jan. 10, 2022, 5:07 p.m.