From hpages at fhcrc.org  Tue Oct  2 04:28:29 2007
From: hpages at fhcrc.org (hpages at fhcrc.org)
Date: Mon,  1 Oct 2007 19:28:29 -0700
Subject: [Rd] pairlist objects
Message-ID: <1191292109.4701accd24217@webmail.fhcrc.org>

Hi,

?pairlist gives no explanation about what exactly is the difference
between a pairlist and a list (except that a pairlist of length 0
is 'NULL'). So, what's a pairlist?

class(.Options)
[1] "pairlist"

Some strange things about the "pairlist" type:

  > showClass("pairlist")
  Error in getClass(Class) : "pairlist" is not a defined class

Why the above doesn't work? It works for "list":

  > showClass("list")

  No Slots, prototype of class "list"

  Extends: "vector"

  > is.list(.Options)
  [1] TRUE

  > is.vector(.Options)
  [1] FALSE

This doesn't make sense! If 'x' is a list, then it should be considered
a vector too.

Subsetting a pairlist with [] doesn't produce a pairlist: 

  > class(.Options[1:3])
  [1] "list"

Yes, this one is documented, but still...


Cheers,
H.



[Rd] pairlist objects
hpages at fhcrc.org