
How it works...
First two lines draw the data frame to be used; the order chosen displays the shapes in regular reading orientation (left-right and top-bottom), as Figure 2.4 shows. Following the data frame creation, ggplot2 package is loaded. Unlike what had been done until now, the plot was not stored into an object but directly called.
Three arguments were tweaked by the geom_point() layer: shape, size, and fill. The first one was declared outside aes() (aesthetics function) and did called each shape by its number. The argument size is meant to increase the points size, but it will only do so if combined with the next layer, scale_size(). The fill argument is set to white; this way, the readers can see that the points from 1 to 20 are not affected by such an argument, while 21 to 25 are.
The layer scale_size() has the size range fixed, so the points size can be increased all together and not proportionally to one another, as ggplot2 would do if this particular layer was skipped. Finally, geom_text() added text to each point. Text given for each shape is telling the reference number of each of them. Argument nudge_y makes sure that text and points would not overlay each other.
Whenever you feel like points shapes should be more carefully thought consider consulting a guide similar to the one given by Figure 2.4 .Function scale_shape_manual() allows you to pick the shapes manually. A good way to start a scatterplot is to try the default settings and only then look for the necessity of a more manual approach.