What does 5 log10

log: logarithms and exponentials

Description

computes logarithms, by default natural logarithms, computes common (i.e., base 10) logarithms, and computes binary (i.e., base 2) logarithms. The general form computes logarithms with base.

computes \ (\ log (1 + x) \) accurately also for \ (| x | \ ll 1 \).

computes the exponential function.

computes \ (\ exp (x) - 1 \) accurately also for \ (| x | \ ll 1 \).

Usage

log (x, base = exp (1)) logb (x, base = exp (1)) log10 (x) log2 (x)

log1p (x)

exp (x) expm1 (x)

Argument

a numeric or complex vector.

a positive or complex number: the base with respect to which logarithms are computed. Defaults to \ (e \) =.

Value

A vector of the same length as containing the transformed values. gives, and for negative values ​​of is. is.

For complex inputs to the log functions, the value is a complex number with imaginary part in the range \ ([- \ pi, \ pi] \): which end of the range is used might be platform-specific.

S4 methods

,,,, and are S4 generic and are members of the group generic.

Note that this means that the S4 generic for has a signature with only one argument, but that can be passed to methods (but will not be used for method selection). On the other hand, if you only set a method for the group generic then argument of will be ignored for your class.

Details

All except are generic functions: methods can be defined for them individually or via the group generic.

and are only convenience wrappers, but logs to bases 10 and 2 (whether computed via or the wrappers) will be computed more efficiently and accurately where supported by the OS. Methods can be set for them individually (and otherwise methods for will be used).

is a wrapper for for compatibility with S. If (S3 or S4) methods are set for they will be dispatched. Do not set S4 methods on itself.

All except are primitive functions.

References

Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks / Cole. (for, and.)

Chambers, J. M. (1998) Programming with data. A Guide to the S Language. Jumper. (for.)

See So

, , .

Examples

# NOT RUN {log (exp (3)) log10 (1e7) # = 7 x <- 10 ^ - (1 + 2 * 1: 9) cbind (x, log (1 + x), log1p (x), exp (x) -1, expm1 (x)) #}