## Load the example `learnt` object calculated from the "penguins" dataset;
## variates: 'species' and 'bill_len'
learnt <- learntExample
## Calculate the 3 x 2 probabilities for the 3 species
## given bill-lengths of 43 mm and 44 mm
Y <- data.frame(species = c('Adelie', 'Chinstrap', 'Gentoo'))
X <- data.frame(bill_len = c(43, 44))
probs <- Pr(Y = Y, X = X, learnt = learnt, parallel = 1)
## display the values and variabilities of these probabilities
print(probs)
## diplay 'values' only, and only for the species value 'Gentoo'
print(probs, elements = 'values', subset = list(species = 'Gentoo'))
Run the code above in your browser using DataLab