library(rdemopkg)

We can use the logit command to calculate the log odds of a vector of probabilities. For example,

logit(probabilities$p)
#> [1] -2.197225 -1.098612  0.000000  1.098612  2.197225