Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R mathematical annotations

I have a problem inserting a vertical line in a mathematical annotation. I have search through the annotation symbols without luck.

I would like to put a mathematical annotation containing conditional probability sign (|) in the x-label of a plot. What I would like is the expression p(x_j | o_i) where "j" and "i" are subscripts.

I have the following construction

plot(1:10, xlab = expression( paste("Likelihood, p" * (y[i] %up% o[j])) ))

and I wold like to substitute the arrow with a vertical line. Any help or guidance is greatly appreciated.

like image 918
Sisse Avatar asked Dec 20 '22 19:12

Sisse


1 Answers

This gets you "there" (for some definition of "there"):

plot(1:10, xlab = expression("Likelihood, p" * (y[i] ~ "|" ~ o[j])))

plotmath axis label

like image 177
Gavin Simpson Avatar answered Jan 14 '23 03:01

Gavin Simpson