#' soft function
#'
#' soft thresholding
#' @param x vector
#' @param lambda penalty
#' @export
#' soft
#'
soft = function(x, lambda) {
sign(x) * pmax(0, abs(x) - lambda)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.