From hpages at fhcrc.org  Sat Jun  8 00:08:06 2013
From: hpages at fhcrc.org (=?ISO-8859-1?Q?Herv=E9_Pag=E8s?=)
Date: Fri, 07 Jun 2013 15:08:06 -0700
Subject: [Rd] relist() is broken when the skeleton is a list with empty list
	elements
Message-ID: <51B259C6.8090302@fhcrc.org>

Hi,

relist() is broken when the skeleton is a list with empty list elements:

   > x <- list(1:3, integer(0), 11:14)

   > relist(unlist(x), x)
   [[1]]
   [1] 1 2 3

   [[2]]
   [1] 11  3

   [[3]]
   [1] 11 12 13 14

Hard to believe that such a bug has been around for 6 years (i.e. since
the introduction of relist()) without ever being noticed.

Cheers,
H.

 > sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
  [7] LC_PAPER=C                 LC_NAME=C
  [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

-- 
Herv? Pag?s

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



[Rd] relist() is broken when the skeleton is a list with empty list elements
=?ISO-8859-1?Q?Herv=E9_Pag=E8s?=