Session Ready
Exercise

Changing plotting characters

Grouped displays in lattice normally use color to distinguish between groups. Sometimes it is also helpful to use different plotting symbols or line types for different groups, so that they can be distinguished even in black and white printouts.

Plotting symbols (or plotting characters) are controlled by the graphical parameter pch, which can be supplied as an optional argument. Many values of pch are allowed, but you will use the two values 1 and 3 to distinguish between males and females in the USMortality data. The value of 1 represents an open circle, and the value of 3 represents a plus (+) symbol.

Instructions
100 XP

The USMortality data has been pre-loaded, and sample code to create a dot plot of Rate by Cause conditioned on Status and grouped by Sex is given.

Fill in suitable values of pch so that:

  • The data points for males are indicated by an open circle (pch = 1).
  • Those for females are indicated by a plus symbol (pch = 3).

Be careful about the order; graphical parameters in grouped displays are matched to respective levels of the grouping variable, and are recycled if necessary.