| log2signed | R Documentation |
log2 transformation with directionality
log2signed(x, offset = 1, base = 2, ...)
x |
|
offset |
|
base |
|
... |
additional arguments are ignored. |
This function applies a log2 transformation but maintains the sign of the input data, allowing for log2 transformation of negative values.
The method applies an offset to the absolute value abs(x),
in order to handle values between zero and 1, then applies
log2 transformation, then multiplies by the original sign
from sign(x).
The argument offset is used to adjust values, for example
offset=1 will apply log2 transformation log2(1 + x),
except using the absolute value of x. This method allows
for positive and negative input data to contain values
between 0 and 1, and between -1 and 0.
This function could be described as applying
a log2 transformation of the "magnitude" of values in x,
while maintaining the positive or negative directionality.
If any abs(x) are less than offset this function will
raise an error.
numeric vector of log-transformed magnitudes.
Other jam practical functions:
breakDensity(),
call_fn_ellipsis(),
checkLightMode(),
check_pkg_installed(),
colNum2excelName(),
color_dither(),
exp2signed(),
getAxisLabel(),
isFALSEV(),
isTRUEV(),
jargs(),
kable_coloring(),
lldf(),
middle(),
minorLogTicks(),
newestFile(),
printDebug(),
reload_rmarkdown_cache(),
renameColumn(),
rmInfinite(),
rmNA(),
rmNAs(),
rmNULL(),
setPrompt()
x <- c(-100:100)/10;
log2signed(x);
plot(x=x, y=log2signed(x), xlab="x", ylab="log2signed(x)")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.