lapply(list(1, "a", TRUE), str)
This call actually returns a list, the same size as the input list, containing all
NULL values. On the other hand calling
on its own prints only the structure of the logical to the console, not
NULL . That's because [
str() ] uses [
invisible() ] behind the scenes, which returns an invisible copy of the return value,
NULL in this case. This prevents it from being printed when the result of
str() is not assigned.
Sorry, I cannot understand the explanation here on DataCamp. Can anyone give me an easy explanation?