how to not match partial names
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