From henrik.bengtsson at gmail.com  Wed Oct 12 18:20:53 2016
From: henrik.bengtsson at gmail.com (Henrik Bengtsson)
Date: Wed, 12 Oct 2016 09:20:53 -0700
Subject: [Rd] How to assign NULL value to pairlist element while keeping it
	a pairlist?
Message-ID: <CAFDcVCQEA8Q7Zec6m3mF4PY4mL=VJOihGtXRbKiPq98hKMfY2A@mail.gmail.com>

Hi, I seem to not be able to assign NULL to an element of a pairlist
without causing it to be coerced to a plain list.  For example:

> x <- pairlist(1, 2)
> class(x)
[1] "pairlist"

> x[1] <- list(NULL)
> class(x)
[1] "list"

This actually true for all [()<- assignments regardless of list value, e.g.

> x <- pairlist(1, 2)
> x[1] <- list(0)
[1] "list"

I also tried assigning a pairlist(), but still the same problem:

> x <- pairlist(1, 2)
> x[1] <- pairlist(0)
[1] "list"

The only workaround I'm aware of is to:

x <- as.pairlist(x)

at the end.  Any other suggestions?

Thanks,

Henrik



[Rd] How to assign NULL value to pairlist element while keeping it a pairlist?
Henrik Bengtsson