ffp | R Documentation |
ffp
ClassHelpers and Constructors from ffp
.
ffp(x = double(), ...) is_ffp(x) as_ffp(x) ## Default S3 method: as_ffp(x) ## S3 method for class 'integer' as_ffp(x)
x |
|
... |
Additional attributes to be passed to |
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.
ffp()
and as_ffp()
return an S3 vector of class ffp
(built upon double
's);
is_ffp()
returns a logical
object.
set.seed(123) p <- runif(5) p <- p / sum(p) is_ffp(p) as_ffp(p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.