From the course: R for Data Science: Lunch Break Lessons

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

lattice: stripplot

lattice: stripplot

- [Instructor] Let's talk about another Lattice graphics function. This one is called stripplot. To use strip plot, of course, you need to bring in the library for Lattice. (keyboard clicks) And once I've typed in, library lattice, on my Windows machine, I can hit Control + Enter. Optionally, you can also just simply click on the Run button. Now, to build a stripplot, it's easy. S-T-R-I-P-P-L-O-T, and then you use the formula, diet against weight. And the data is going to come from chickweight. (keyboard clicks) Now it's important that you note that stripplot requires that this is a factor versus numeric formula. When I run that line, you'll see that I get the diet factors along the Y axis, and the weight along the X axis. Now, all of those points are graphed on top of each other, and we might want to be able to see a little bit better representation of what that data looks like. We can use jitter, so I'll add…

Contents