Skip to content
Prev 39821 / 63421 Next

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

On Apr 14, 2011, at 5:13 PM, Janko Thyson wrote:

            
Technically, you're not nesting pairlists - you' are putting a generic vector in a parilist ... (not that it matters here).
relist() has no method for pairlists - but you can actually use the "list" method as-is:
Dotted pair list of 3
 $ a: num 1
 $ b: num 2
 $ c:List of 2
  ..$ c.1: num 1
  ..$ c.2: num 2
Dotted pair list of 3
 $ a: num 1
 $ b: num 2
 $ c:List of 2
  ..$ c.1: num 1
  ..$ c.2: num 2
 - attr(*, "class")= chr [1:2] "relistable" "pairlist"

and that will also support actual nested pairlists:
Dotted pair list of 3
 $ a: num 1
 $ b: num 2
 $ c:Dotted pair list of 2
  ..$ c.1: num 1
  ..$ c.2: num 2
Dotted pair list of 3
 $ a: num 1
 $ b: num 2
 $ c:Dotted pair list of 2
  ..$ c.1: num 1
  ..$ c.2: num 2
 - attr(*, "class")= chr [1:2] "relistable" "pairlist"


so I guess it should be easy to add relist.pairlist to utils ... I'm not sure about the implications, but it does sound appealing.

Cheers,
Simon