| invert_sign | R Documentation |
invert_sign() inverts ptvalues' sign.
abs_sign() converts ptvalues' sign to an 'absolute' sign, times or div.
as_times() converts ptvalues' sign to all times.
as_div() converts ptvalues' sign to all div.
invert_sign(x = double())
abs_sign(x = double(), sign = "times")
as_times(x = double())
as_div(x = double())
x |
A vector of class ptvalue or a numeric vector. If a numeric vector is provided, values must be greater than 0. |
sign |
Either |
The function invert_sign() is the same as applying \frac{1}{x} with
the underlying numeric values of ptvalues. Times values (\times) will
be converted to div (\div) and div to times.
The function abs_sign() finds the multiplicative absolute values where all
times and div values are converted to times values (by default). It can also
converts to all div values by specifying sign = "div".
Functions as_times() and as_div() are wrappers of abs_sign() where
sign = "times" is specified for as_times() and sign = "div" is
specified for as_div().
All functions will return a vector of class ptvalue even when providing
a numeric vector for x as it is the expected use. To see the underlying
numeric vector, you can use unclass() or as.double().
A vector of class ptvalue.
x <- ptvalue(c(0.25, 0.5, 1, 2, 4))
x
abs_sign(x)
invert_sign(x)
as_times(x)
as_div(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.