Skip to contents

From a probability form as a list create text

Usage

make_prob_names(form, values, letter = "P")

Arguments

form

A prob.form object

values

A data frame containing variables appearing in form and their values

letter

An optional character string to put at the start of the probability, e.g., "p" or "Pr"

Value

A character vector

Examples

make_prob_names(list(out = c("Y", "X"), cond = "Z"),
values = expand.grid(Y = 0:1, X = 0:1, Z = 0:1), letter = "Pr")
#> [1] "Pr(Y = 0, X = 0 | Z = 0)" "Pr(Y = 1, X = 0 | Z = 0)"
#> [3] "Pr(Y = 0, X = 1 | Z = 0)" "Pr(Y = 1, X = 1 | Z = 0)"
#> [5] "Pr(Y = 0, X = 0 | Z = 1)" "Pr(Y = 1, X = 0 | Z = 1)"
#> [7] "Pr(Y = 0, X = 1 | Z = 1)" "Pr(Y = 1, X = 1 | Z = 1)"