We continue to discuss data structures in R, this time focusing on lists. Unlike vectors, matrices and arrays, the elements of a list may be of different modes. This makes them very flexible and important in R programming. We cover how to form lists and two different ways to assign names to list elements. Because many R functions return values in the form of a list, it is important to know how to deal with lists and access their contents. We illustrate these skills with an example involving a fitted linear model object, which is a list containing information about a fitted multiple linear regression. While watching this video you should open
Mod10Script.R and follow along with Example 6.
This video covers fundamental material of great importance for R
programming, so I highly encourage you to watch it. However, if you have prior experience using lists in R, the
content here may be a review for you.