labit: Create Label with Italic

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/labit.R

Description

Paste two strings and create a plot label, where the second string is italic.

Usage

1
labit(x, y, bold=FALSE, sep=" ")

Arguments

x

string to render in roman.

y

string to render in italic.

bold

whether the first string should be in boldface.

sep

string to separate the text strings.

Value

expression that can be passed to plot functions as annotation.

Note

Designed for plots in the annual stock assessment summary report.

Author(s)

Arni Magnusson and Hoskuldur Bjornsson.

References

Marine Research Institute. 2010. State of marine stocks in Icelandic waters 2009/2010. Available at http://www.hafro.is/Astand/2010/ASTAND-10.pdf.

See Also

plotmath provides the mechanism to combine roman, italic, and boldface strings in one plot label.

hafroAssmt-package gives an overview of the package.

Examples

1
2
3
4
5
6
7
8
9
## Plain and italic:
plot(1, xlab=labit("Aldur", "Age"))
## equivalent to
plot(1, xlab=expression(paste("Aldur ", italic("Age"))))

## Bold and italic:
plot(1, xlab=labit("Aldur", "Age", bold=TRUE))
## equivalent to
plot(1, xlab=expression(paste(bold("Aldur "), italic("Age"))))

hafroAssmt documentation built on May 2, 2019, 5:47 p.m.