R/s4_example.R

Defines functions foobar foobar.numeric foobar.character

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)])
liuyishen418/mypkg documentation built on Nov. 4, 2019, 4:35 p.m.