Skip to content

Commit

Permalink
export 'logm1' und 'expp1'
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-buerkner committed Jan 18, 2017
1 parent 8151396 commit 39192de
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Expand Up @@ -97,6 +97,7 @@ export(cumulative)
export(exgaussian)
export(exponential)
export(expose_functions)
export(expp1)
export(fixef)
export(frechet)
export(geometric)
Expand All @@ -117,6 +118,7 @@ export(is.cor_fixed)
export(launch_shiny)
export(log_lik)
export(log_posterior)
export(logm1)
export(lognormal)
export(loo)
export(make_stancode)
Expand Down
24 changes: 20 additions & 4 deletions R/misc.R
Expand Up @@ -331,10 +331,26 @@ log1m <- function(x) {
log(1 - x)
}

logm1 <- function(x) {
log(x - 1)
}

#' Logarithm with a minus one offset.
#'
#' Computes \code{log(x - 1)}.
#'
#' @param x A numeric or complex vector.
#' @param base A positive or complex number: the base with respect to which
#' logarithms are computed. Defaults to \emph{e} = \code{exp(1)}.
#'
#' @export
logm1 <- function(x, base = exp(1)) {
log(x - 1, base = base)
}

#' Exponential function plus one.
#'
#' Computes \code{exp(x) + 1}.
#'
#' @param x A numeric or complex vector.
#'
#' @export
expp1 <- function(x) {
exp(x) + 1
}
Expand Down
15 changes: 15 additions & 0 deletions man/expp1.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions man/logm1.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 39192de

Please sign in to comment.