A list is a generic vector containing other objects.
For example, the following variable x is a list containing copies of three vectors n, s, b, and a numeric value 3.
> s = c("aa", "bb", "cc", "dd", "ee")
> b = c(TRUE, FALSE, TRUE, FALSE, FALSE)
> x = list(n, s, b, 3) # x contains copies of n, s, b
We retrieve a list slice with the single square bracket "" operator. The following is a slice containing the second member of x, which is a copy of s.
With an index vector, we can retrieve a slice with multiple members. Here a slice containing the second and fourth members of x.
In order to reference a list member directly, we have to use the double square bracket "[]" operator. The following object x[] is the second member of x. In other words, x[] is a copy of s, but is not a slice containing s or its copy.
We can modify its content directly.