# Basic examples
x <- c(0.5, 0.8, 1, 1.25, 2)
ptvalue(x)
ptvalue(0)
ptvalue(NA)
ptvalue(Inf)
# For convenience, `div()` can be used to
# create decaying values without using decimal values
ptvalue(c(0.5, 0.8))
div(c(2, 1.25))
x <- ptvalue(2)
is_ptvalue(x)
x <- 2
is_ptvalue(x)
x <- c(0.5, 1, 2)
as_ptvalue(x)
Run the code above in your browser using DataLab