课程: R for Data Science: Lunch Break Lessons

免费学习该课程!

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

dimnames

dimnames

- [Instructor] We've discussed arrays way back at the beginning of this series. But in review, an array is a collection of matrices where each level is a two-dimension array of values that are the same. There is a way to add additional information to an array and that's through the use of a command called dimnames. So let's look at how that works. First, let's create an array. And in order to do that, I need some vectors. So I'm going to create sample1, sample2, and sample3. And now I'm going to use those samples to create an array called AnimalPlanet. Let's take a look at what that actually has done. So I'm going to come down to the console, clear it, and type in AnimalPlanet. And look at the contents of AnimalPlanet. And what you'll see here is I have three levels, each level consisting of a two-dimensional matrix, two rows and five columns. So AnimalPlanet is a collection of matrices. Well, that's great, but this is all very mysterious as to what these numbers actually represent…

内容