From janko.thyson.rstuff at googlemail.com  Thu Apr 14 23:13:43 2011
From: janko.thyson.rstuff at googlemail.com (Janko Thyson)
Date: Thu, 14 Apr 2011 23:13:43 +0200
Subject: [Rd] Possible bug in 'relist()' and/or 'as.relistable()'
Message-ID: <4da76321.017b0e0a.123e.4d54@mx.google.com>

Dear list,

I think I just stumbled across a bug in either 'relist()' and/or
'as.relistable()'. It seems that 'pairlists' can only be un- and relisted as
long as they're not nested:

Good:
a <- as.relistable(as.pairlist(list(a=1, b=2)))
a <- unlist(a)
relist(a)# Works

Bad:
a <- as.relistable(as.pairlist(list(a=1, b=2, c=list(c.1=1, c.2=2))))
a <- unlist(a)
relist(a)

The help page didn't say anything about pairlists and I don't know if
they're at all relevant, but I'm using them whenever I want my functions to
recognize a clear 'name-value' structure (e.g. for batch assigning
variables) as opposed to standard list structures.

Cheers,
Janko

>     sessionInfo()
R version 2.12.1 (2010-12-16)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252   
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                   
[5] LC_TIME=German_Germany.1252    

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

loaded via a namespace (and not attached):
[1] codetools_0.2-8 tools_2.12.1



[Rd] Possible bug in 'relist()' and/or 'as.relistable()'
Janko Thyson