I want to print the variables z in the plot. I have added
CodePudding user response:
Create the string and parse it.
labels <- parse(text = sprintf("sigma == %f", z))
Words can be separated with ~ symbols or combined into a single literal using quotes. * can be used for juxtaposition.
labels <- parse(text = sprintf("Case ~ (%d) ~ sigma == %f", 1:3, z))
labels <- parse(text = sprintf("Case ~ (%d) * ':' ~ sigma == %f", 1:3, z))
labels <- parse(text = sprintf("'Case (%d) sigma' == %f", 1:3, z))
labels <- parse(text = sprintf("'Case (%d): sigma' == %f", 1:3, z))
Try demo("plotmath")
for more info.