R Data StructuresLesson 19Free preview
R Lists
This lesson is part of R · All levels
Summary
This study reviews List data structures in R that are capable of accommodating a variety of heterogeneous data types and objects. In one list, you can store numbers, strings, vectors, matrices, even other functions. Developers will study the indexing differences using single square brackets '[' and double '[['.
Key points
- The list contains elements with different data types and structures
- Created using the 'list(nama1 = val1, nama2 = val2, ...)' function
- Single square brackets 'list[1]' return sub-lists that are still list-type
- Square brackets double 'list[[1]]' or dollar sign 'list$name' extract the contents of the original element
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.