Skip to main content

6.7) More On Graphics: Annotation (cont'd)


Elements of objects (e.g. statistics from a list) are printed if you simply refer to them without quotation marks (e.g. text(x=1, y=5, labels=DATA.cor.test$statistic)). To concatenate these with text, supply them as arguments to paste(): e.g. text(x=1, y=5, labels=paste("r=",DATA.cor.test$statistic)). To combine object values with symbols, try the clever function bquote(): e.g., if a is 3, then bquote(alpha==.(a)) will print "α = 3". You may also need:

round() to round a number to a specified number (digits=) of decimal places; or
signif() to round a number to a specified number (digits=) of significant figures.