Re: [R] how to not match partial names

2011-05-07 Thread Tóth Dénes
> Dear friends, > > How do I stop partial matching of list names? > > e.g., > > x <- list(="a", B="b") > is.null(x$A) #returns FALSE even though there is no element A. > > if(is.null(x$A)) {result <- x$} else {result <- x$A} > result #is even though there is no x$A e

Re: [R] how to not match partial names

2011-05-07 Thread Duncan Murdoch
On 07/05/2011 7:09 PM, William Revelle wrote: Dear friends, How do I stop partial matching of list names? e.g., x<- list(="a", B="b") is.null(x$A) #returns FALSE even though there is no element A. if(is.null(x$A)) {result<- x$} else {result<- x$A} result #is ev

Re: [R] how to not match partial names

2011-05-07 Thread Thomas Lumley
On Sun, May 8, 2011 at 11:09 AM, William Revelle wrote: > Dear friends, > > How do I stop partial matching of list names? > > e.g., > > x <- list(="a", B="b") > is.null(x$A)   #returns FALSE  even though there is no element A. > > if(is.null(x$A))  {result <-  x$} else {result

[R] how to not match partial names

2011-05-07 Thread William Revelle
Dear friends, How do I stop partial matching of list names? e.g., x <- list(="a", B="b") is.null(x$A) #returns FALSE even though there is no element A. if(is.null(x$A)) {result <- x$} else {result <- x$A} result #is even though there is no x$A element x <- list