The first thing we will do next is to check that lattice
works properly. For this example, we will use the iris
dataset. The iris
dataset is one of the best known in data science. It is composed of four numeric attributes Sepal.Length
, Sepal.Width
, Petal.Length
and Petal.Width
which are measures of iris plants, as well as a factor, or nominal attribute Species
which describes the membership of the plants to 3 different iris species: Virginica, Setosa and Versicolor. The data set is composed of 150 observations.
Doing this first plot will also allow us to discover the formula syntax used in most plots with lattice
:
xyplot(Sepal.Length ~ Sepal.Width | Species, data = iris)
In this line of code, we have used the xyplot()
function to visualize the relationship between the sepal length and the sepal width of iris flowers conditioning on Species
. This means that one scatterplot is produced for each of the groups. The function xyplot()
, as well as...