Skip to content
Prev 53756 / 63421 Next

Odd behaviour in within.list() when deleting 2+ variables

This seems to be due to changes made by Martin Maechler in 2008. Presumably this fixed something, but it escapes my memory.

However, it seems to have broken the equivalence between within.list and within.data.frame, so now

within.list <- within.data.frame

does not suffice.

The crux of the matter seems to be that both the following constructions work for data frames
[1] "Ozone"   "Solar.R" "Wind"    "Temp"    "Month"   "Day"
Ozone Solar.R Month Day
1    41     190     5   1
2    36     118     5   2
3    12     149     5   3
4    18     313     5   4
5    NA      NA     5   5
6    28      NA     5   6
Ozone Solar.R Month Day
1    41     190     5   1
2    36     118     5   2
3    12     149     5   3
4    18     313     5   4
5    NA      NA     5   5
6    28      NA     5   6

However, for lists they differ:
$Ozone
[1] 41 36 12 18 NA 28

$Solar.R
[1] 190 118 149 313  NA  NA

$Wind
NULL

$Temp
NULL

$Month
[1] 5 5 5 5 5 5

$Day
[1] 1 2 3 4 5 6
$Ozone
[1] 41 36 12 18 NA 28

$Solar.R
[1] 190 118 149 313  NA  NA

$Month
[1] 5 5 5 5 5 5

$Day
[1] 1 2 3 4 5 6


-pd