Message-ID: <BANLkTiks__=cu1uxwyX-xCP1M6E7KeR7fw@mail.gmail.com>
Date: 2011-05-07T23:18:36Z
From: Thomas Lumley
Subject: how to not match partial names
In-Reply-To: <p06240814c9eb818a2744@165.124.218.235>
On Sun, May 8, 2011 at 11:09 AM, William Revelle <lists at revelle.net> wrote:
> Dear friends,
>
> How do I stop partial matching of list names?
>
> e.g.,
>
> x <- list(AAAA="aaaaa", BBBBB="bbbbb")
> is.null(x$A) ? #returns FALSE ?even though there is no element A.
>
> if(is.null(x$A)) ?{result <- ?x$BBBB} else {result <- x$A}
> result ? #is aaaa even though there is no x$A element
>
x[["A"]]
-thomas
--
Thomas Lumley
Professor of Biostatistics
University of Auckland