x | P(x), of dist object x.R/dist.R
conditional.dist.RdFalls back to MC: materializes x via ensure_realized() and
then conditions on the resulting empirical distribution.
# S3 method for class 'dist'
conditional(x, P, n = 10000L, ...)An empirical_dist approximating the conditional distribution.
# \donttest{
set.seed(1)
x <- exponential(1)
# Condition on X > 2
x_gt2 <- conditional(x, function(t) t > 2)
mean(x_gt2)
#> [1] 3.030498
# }