For most data analysis, we can just use the default fonts for titles. However, sometimes, we might want to choose different fonts for presentation and publication purposes. Selecting fonts can be tricky, as this depends on the operating system and the graphics device. We will see some simple ways to choose fonts in this recipe.
All you need to try out in this recipe is to run R and type the recipe in the command prompt. You can also choose to save the recipe as a script so that you can use it again later on.
The font family and face can be set with the par()
command:
par(family="serif",font=2)
A font is specified in two parts: a font family
(such as Helvetica or Arial) and a font face
within family
(such as bold or italic).
The available font families vary by operating system and graphics devices. So, R provides some proxy values that are mapped on to the relevant available fonts irrespective of the system. Standard...