From hongooi at microsoft.com  Mon Jun 26 04:40:09 2017
From: hongooi at microsoft.com (Hong Ooi)
Date: Mon, 26 Jun 2017 02:40:09 +0000
Subject: [Rd] Odd behaviour in within.list() when deleting 2+ variables
Message-ID: <HK2P15301MB008352A35CE4FFA43874AD50A6DF0@HK2P15301MB0083.APCP153.PROD.OUTLOOK.COM>

The behaviour of within() with list input changes if you delete 2 or more variables, compared to deleting one:

l <- list(x=1, y=2, z=3)

within(l,
{
    rm(z)
})
#$x
#[1] 1
#
#$y
#[1] 2


within(l, {
    rm(y)
    rm(z)
})
#$x
#[1] 1
#
#$y
#NULL
#
#$z
#NULL


When 2 or more variables are deleted, the list entries are instead set to NULL. Is this intended?



[Rd] Odd behaviour in within.list() when deleting 2+ variables
Hong Ooi