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()
,
checkLightMode()
,
check_pkg_installed()
,
colNum2excelName()
,
color_dither()
,
diff_functions()
,
exp2signed()
,
fileInfo()
,
fixYellow()
,
getAxisLabel()
,
handleArgsText()
,
heads()
,
isFALSEV()
,
isTRUEV()
,
jamba
,
jargs()
,
kable_coloring()
,
lldf()
,
make_html_styles()
,
make_styles()
,
match_unique()
,
mergeAllXY()
,
middle()
,
minorLogTicks()
,
newestFile()
,
printDebug()
,
renameColumn()
,
rmInfinite()
,
rmNAs()
,
rmNA()
,
rmNULL()
,
sclass()
,
sdim()
,
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.