書名: 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