课程: R for Data Science: Lunch Break Lessons

免费学习该课程!

今天就开通帐号,24,100 门业界名师课程任您挑!

coplot

coplot

- [Instructor] The graphics package that is part of the base R programming language includes several plot types, and one of them is called conditional plots. So let's take a look at what that is and how it works. There are times when you're going to want to graph a relationship across a set of conditioning variables, and that's what coplot is for. Here's how it looks. C-O-P-L-O-T and you had a parentheses, and then you set up an equation that you'd like to plot. In this case, ChickWeight, and I want to plot the weight variable of ChickWeight against, and that's what that tilde is for. ChickWeight time, so let's select Time, and the conditioning variable that I want to use is diet, so I'll type in ChickWeight dollar sign Diet. And I hit Ctrl + Return and that produces for me the graph that you see on the right-hand side. You'll notice that I have four plots. There are four diets, and so it's created one plot for each diet. The top part of the graph, the one, two, three, four, there's a…

内容