Good morning everyone,
I have a very simple question.
foo <- list(bar=2)
As you all know, I can access the bar object with brackets or using the cashtag ($) symbol.
> foo$bar
[1] 2
> foo[["bar"]]
[1] 2
If I replace bar with ba, I will get the same result with the cashtag ($), but a different one with the brackets.
> foo$ba
[1] 2
> foo[["ba"]]
NULL
Is there a way to obtain the result NULL instead of 2 using the cashtag ($) in this situation?