- Machine Learning with R Quick Start Guide
- Iván Pastor Sanz
- 46字
- 2021-06-24 16:01:31
Accessing components and elements in a list
To access each component in a list, a double bracket should be used:
x[[1]]
## [1] 1 2 3 4
However, it is possible to access each element of a list as well:
x[[1]][2:4]
## [1] 2 3 4