#' Flaechentransformation
#'
#' Einfache Funktion zur Flaechentransformation.
#'
#' @param data Numerischer Vektor
#'
#' @return Vektor der Laenge \code{unique(data)}
#' @export
#' @examples
#' data <- round(runif(20, 1, 10), 0)
#' fltrans(data)
fltrans <- function(data){
tbl <- table(data)
h_j <- prop.table(tbl)
H_j <- cumsum(h_j)
n <- length(tbl)
ft <- numeric(n)
ft[1] <- h_j[1]/2
for (i in 2:n) {
ft[i] <- H_j[i - 1] + h_j[i]/2
}
return(ft)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.