R/test.R

Defines functions foobar.character foobar.numeric foobar

Documented in foobar foobar.character foobar.numeric

#' Foo bar generic
#'
#' @param x Object to foo.
foobar <- function(x) UseMethod("foobar")

#' @describeIn foobar Difference between the mean and the median
foobar.numeric <- function(x) abs(mean(x) - median(x))

#' @describeIn foobar First and last values pasted together in a string.
foobar.character <- function(x) paste0(x[1], "-", x[length(x)])
matschmitz/schmitz documentation built on May 15, 2022, 4:15 p.m.