Reader small image

You're reading from  Learning Predictive Analytics with R

Product typeBook
Published inSep 2015
Reading LevelIntermediate
PublisherPackt
ISBN-139781782169352
Edition1st Edition
Languages
Right arrow
Author (1)
Eric Mayor
Eric Mayor
author image
Eric Mayor

Eric Mayor is a senior researcher and lecturer at the University of Neuchatel, Switzerland. He is an enthusiastic user of open source and proprietary predictive analytics software packages, such as R, Rapidminer, and Weka. He analyzes data on a daily basis and is keen to share his knowledge in a simple way.
Read more about Eric Mayor

Right arrow

Discovering multipanel conditioning with xyplot()


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...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learning Predictive Analytics with R
Published in: Sep 2015Publisher: PacktISBN-13: 9781782169352

Author (1)

author image
Eric Mayor

Eric Mayor is a senior researcher and lecturer at the University of Neuchatel, Switzerland. He is an enthusiastic user of open source and proprietary predictive analytics software packages, such as R, Rapidminer, and Weka. He analyzes data on a daily basis and is keen to share his knowledge in a simple way.
Read more about Eric Mayor