Computes the marginal distribution of a set of variables.
marginal(space, vars = NULL)
a data frame probability space or a subset of one.
an optional character vector of variable names in space
.
A data frame with a probs
column.
If vars
is not specified, then marginal()
will set vars
to be all non-probs
columns, which can be useful in the case that it is desired to aggregate duplicated rows.
See addrv
for adding random variables to a data frame probability space.
# NOT RUN {
S <- rolldie(3, makespace = TRUE)
marginal(S, vars = c("X1", "X2"))
# }
Run the code above in your browser using DataLab