Re: [Rd] possible bug: NULL equality in lists.

2006-03-07 Thread Uwe Ligges
Seth Falcon wrote: > Uwe Ligges <[EMAIL PROTECTED]> writes: > >>>Point taken, but is the behavior of as.character correct? >>>as.character(list(NULL)) >>>as.character(NULL) >> >> >>I thought about it quite a while. I think the current bahaviour is >>quite OK. What should as.character do in the fo

Re: [Rd] possible bug: NULL equality in lists.

2006-03-07 Thread Seth Falcon
Uwe Ligges <[EMAIL PROTECTED]> writes: >> Point taken, but is the behavior of as.character correct? >> as.character(list(NULL)) >> as.character(NULL) > > > I thought about it quite a while. I think the current bahaviour is > quite OK. What should as.character do in the follwing case: >as.charac

Re: [Rd] possible bug: NULL equality in lists.

2006-03-07 Thread Uwe Ligges
Seth Falcon wrote: > Uwe Ligges <[EMAIL PROTECTED]> writes: > >>These are all dangerous, hence use the "safe" ways: >> >>sapply(a, is.null) >>sapply(a, identical, "NULL") >>sapply(a, is.na) >>sapply(a, identical, "NA") > > > Point taken, but is the behavior of as.character correct? > > as.char

Re: [Rd] possible bug: NULL equality in lists.

2006-03-07 Thread Charles Dupont
Uwe Ligges wrote: > Seth Falcon wrote: > > >>Uwe Ligges <[EMAIL PROTECTED]> writes: >> >> >> >>>Charles Dupont wrote: >>> >>> >>> I was messing around with R and I found an example R behaving oddly: a <- alist(NULL, "bob", c(3,6,2,3)) a a == 'NULL' a == "NULL" a == 'c

Re: [Rd] possible bug: NULL equality in lists.

2006-03-07 Thread Seth Falcon
Uwe Ligges <[EMAIL PROTECTED]> writes: > These are all dangerous, hence use the "safe" ways: > > sapply(a, is.null) > sapply(a, identical, "NULL") > sapply(a, is.na) > sapply(a, identical, "NA") Point taken, but is the behavior of as.character correct? as.character(list(NULL)) as.character(NULL)

Re: [Rd] possible bug: NULL equality in lists.

2006-03-07 Thread Uwe Ligges
Seth Falcon wrote: > Uwe Ligges <[EMAIL PROTECTED]> writes: > > >>Charles Dupont wrote: >> >> >>>I was messing around with R and I found an example R behaving oddly: >>> >>>a <- alist(NULL, "bob", c(3,6,2,3)) >>>a >>>a == 'NULL' >>>a == "NULL" >>>a == 'cat' >>> >> >> >>Always use is.null() to te

Re: [Rd] possible bug: NULL equality in lists.

2006-03-07 Thread Dimitris Rizopoulos
apucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://www.med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: "Seth Falcon" <[EMAIL PROTECTED]> To: Sent: Tuesday, March 07,

Re: [Rd] possible bug: NULL equality in lists.

2006-03-07 Thread Seth Falcon
Uwe Ligges <[EMAIL PROTECTED]> writes: > Charles Dupont wrote: > >> I was messing around with R and I found an example R behaving oddly: >> >> a <- alist(NULL, "bob", c(3,6,2,3)) >> a >> a == 'NULL' >> a == "NULL" >> a == 'cat' >> > > > Always use is.null() to test on NULL, as in: What should I

Re: [Rd] possible bug: NULL equality in lists.

2006-03-07 Thread Uwe Ligges
Charles Dupont wrote: > I was messing around with R and I found an example R behaving oddly: > > a <- alist(NULL, "bob", c(3,6,2,3)) > a > a == 'NULL' > a == "NULL" > a == 'cat' > Always use is.null() to test on NULL, as in: sapply(a, is.null) Uwe Ligges > If I create a list with a NUL

[Rd] possible bug: NULL equality in lists.

2006-03-07 Thread Charles Dupont
I was messing around with R and I found an example R behaving oddly: a <- alist(NULL, "bob", c(3,6,2,3)) a a == 'NULL' a == "NULL" a == 'cat' If I create a list with a NULL value >a <- alist(NULL, "bob", c(3,6,2,3)) >a [[1]] NULL [[2]] [1] "bob" [[3]] c(3, 6, 2, 3) and run some tests on '