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

Janko Thyson janko.thyson.rstuff at googlemail.com
Thu Apr 14 23:13:43 CEST 2011


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



More information about the R-devel mailing list