It is rather straightforward to add mathematical annotation in a plot with R. However, I have noted that people struggle with the two following :
- combining mathematical expression and text;
- using variables’ values within an expression.
The first one is actually easy, you just need to add and quotation marks to add text in expression
and to use *
to concatenate elements.
|
|
For the second problem, one should use either bquote
or substitute
(check out the documentation of these function) as explained on . Below is an example using text, text format and variables:
|
|