ffp {ffp} | R Documentation |
Manipulate the ffp
Class
Description
Helpers and Constructors from ffp
.
Usage
ffp(x = double(), ...)
is_ffp(x)
as_ffp(x)
## Default S3 method:
as_ffp(x)
## S3 method for class 'integer'
as_ffp(x)
Arguments
x |
|
... |
Additional attributes to be passed to |
Details
The ffp
class is designed to interact with doubles,
but the output of c(ffp, double)
or c(double, ffp)
will always return
a double
(not an ffp
object), since there is no way to guarantee the
interaction between a numeric vector and a probability will also be a probability.
Value
-
ffp()
andas_ffp()
return an S3 vector of classffp
(built upondouble
's); -
is_ffp()
returns alogical
object.
Examples
set.seed(123)
p <- runif(5)
p <- p / sum(p)
is_ffp(p)
as_ffp(p)
[Package ffp version 0.2.2 Index]