Re: [R] Double MAD with R

2020-08-04 Thread varin sacha via R-help
Dear Rui, Many thanks for your response. Best, SV Le lundi 3 août 2020 à 16:54:35 UTC+2, Rui Barradas a écrit : Hello, No, there isn't a built-in that I know of. Here is one: double.mad <- function(x, include.right = FALSE, na.rm = FALSE){   if(na.rm) x <- x[!is.na(x)]   m <-

Re: [R] Double MAD with R

2020-08-03 Thread Rui Barradas
Hello, No, there isn't a built-in that I know of. Here is one: double.mad <- function(x, include.right = FALSE, na.rm = FALSE){   if(na.rm) x <- x[!is.na(x)]   m <- median(x)   odd <- (length(x) %% 2L) == 1L   out <- if(odd){     if(include.right) {   c(lo = mad(x[x < m]), hi = mad(x[x >= m

[R] Double MAD with R

2020-08-03 Thread varin sacha via R-help
Dear R-Experts, Is there an all-ready function to calculate the Double MAD (Median absolute deviation) as there is an easy function to calculate the MAD "mad function". Or I have to write my own function for Double MAD ? To calculate the double MAD, the idea is the following : for the obtained