Why this is not valid? test <- NULL if (test) "test" Alberto Monteiro
On 10/1/2006 12:29 PM, Alberto Vieira Ferreira Monteiro wrote:> Why this is not valid? > > test <- NULL > if (test) "test"The test part of an if statement should evaluate to a length 1 logical or numeric value. NULL is length zero. The R Language Definition explains this (although it implies length > 1 is okay; in fact, that gives a warning). Duncan Murdoch
Alberto Vieira Ferreira Monteiro <albmont <at> centroin.com.br> writes:> Why this is not valid? > > test <- NULL > if (test) "test"What are you trying to do with these statements? I think setting "test" to "False" may do what you want. Of couse, I am just guessing. Anupam.