x <- list(a = 1, b = 2)
# When indexing an element that doesn't exist `[[` sometimes returns NULL:
x[["y"]]
# and sometimes errors:
try(x[[3]])
# chuck() consistently errors:
try(chuck(x, "y"))
try(chuck(x, 3))
Run the code above in your browser using DataLab