If you replace an element of an #Rstats list with NULL, it shortens the list.
Well, sometimes.
> a = list(1, 2, 3, 4, 5)
> b = list(8, NULL, 10)
> length(a)
[1] 5
> a[2:4] = b
> length(a)
[1] 5
> a
[[1]]
[1] 1
[[2]]
[1] 8
[[3]]
NULL
[[4]]
[1] 10
[[5]]
[1] 5
> a[3] = NULL
> length(a)
[1] 4
@peterdrake @data_science I use NULL as a temporary place holder within functions when I want behavior like this. Based on what I've learned, this makes sense for the Language. Is it odd to use NULL in this way for a programming language? R also has NA and NaN, which may reflect the expected behavior more quickly.
@rythur @data_science What's odd is that, between the two different ways of making a list element null, one leaves the null in the list, while the other removes it and shortens the list.
@rythur @data_science Well, I'm looking for the rules, and things like this stick out.
If you like that sort of thing, you'll love Gary Bernhardt's Wat video:
@peterdrake @data_science It had never occurred to me that this might be what computer science was: the rules. We all learn these languages for different reasons and in different ways, and that's great. Keep the rules coming! I like this stuff. Oh, and I'll scope the guy soon. Bed time, finally!