Session Ready
Exercise

Lists

A list in R is similar to your to-do list at work or school: the different items on that list most likely differ in length, characteristic, type of activity that has to do be done.

A list in R allows you to gather a variety of objects under one name (that is, the name of the list) in an ordered way. These objects can be matrices, vectors, data frames, even other lists, etc. It is not even required that these objects are related to each other.

You can easily construct a list using the list() function. In this function you can wrap the different elements like so: list(item1, item2, item3).

Instructions
100 XP
  • Put the objects my_vector, my_matrix and my_df into a list called my_list
  • Make sure to print my_list