The R Project SVN R

Rev

Rev 61160 | Rev 80324 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 61160 Rev 61168
Line 50... Line 50...
50
  \code{\link{median}}, \code{\link{var}}.
50
  \code{\link{median}}, \code{\link{var}}.
51
}
51
}
52
\examples{
52
\examples{
53
mad(c(1:9))
53
mad(c(1:9))
54
print(mad(c(1:9),     constant = 1)) ==
54
print(mad(c(1:9),     constant = 1)) ==
55
      mad(c(1:8,100), constant = 1)       # = 2 ; TRUE
55
      mad(c(1:8, 100), constant = 1)       # = 2 ; TRUE
56
x <- c(1,2,3, 5,7,8)
56
x <- c(1,2,3,5,7,8)
57
sort(abs(x - median(x)))
57
sort(abs(x - median(x)))
58
c(mad(x, constant = 1),
58
c(mad(x, constant = 1),
59
  mad(x, constant = 1, low = TRUE),
59
  mad(x, constant = 1, low = TRUE),
60
  mad(x, constant = 1, high = TRUE))
60
  mad(x, constant = 1, high = TRUE))
61
}
61
}