1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-10 06:21:50 +02:00
This commit is contained in:
2020-05-28 16:48:55 +02:00
parent d9a4b0bcaf
commit b44e2c9202
82 changed files with 448 additions and 517 deletions

View File

@ -27,7 +27,6 @@
#' @inheritSection lifecycle Questioning lifecycle
#' @param x a vector of values, a [`matrix`] or a [`data.frame`]
#' @param na.rm a logical value indicating whether `NA` values should be stripped before the computation proceeds.
#' @exportMethod skewness
#' @seealso [kurtosis()]
#' @rdname skewness
#' @inheritSection AMR Read more on our website!
@ -36,7 +35,7 @@ skewness <- function(x, na.rm = FALSE) {
UseMethod("skewness")
}
#' @exportMethod skewness.default
#' @method skewness default
#' @rdname skewness
#' @export
skewness.default <- function(x, na.rm = FALSE) {
@ -48,14 +47,14 @@ skewness.default <- function(x, na.rm = FALSE) {
(base::sum((x - base::mean(x))^3) / n) / (base::sum((x - base::mean(x)) ^ 2) / n) ^ (3 / 2)
}
#' @exportMethod skewness.matrix
#' @method skewness matrix
#' @rdname skewness
#' @export
skewness.matrix <- function(x, na.rm = FALSE) {
base::apply(x, 2, skewness.default, na.rm = na.rm)
}
#' @exportMethod skewness.data.frame
#' @method skewness data.frame
#' @rdname skewness
#' @export
skewness.data.frame <- function(x, na.rm = FALSE) {