On 22/07/2009, at 1:21 PM, jim holtman wrote:

Notice that three items are returned where you thought one was:

[1] FALSE  TRUE  TRUE  TRUE FALSE
db1$olditems[db1$olditems=='']  #wait, only one item is returned?
[1]
Levels:  nuts soup
db1[db1$olditems=='',]  #somehow this works!
  olditems prices
2            3.25
3            4.42
4            2.25
paste('[',db1$olditems[db1$olditems==''],']') # put some characters around return values
[1] "[  ]" "[  ]" "[  ]"



The '[1]' was just an indication that this is the first value returned
and the other two were blanks so you did not see them.  Also "" is
just that; a blank and not NA.

Strictly speaking --- or maybe even not so strictly --- a ***null character***,
        not a blank.  "" != " "

                cheers,

                        Rolf Turner

        <snip>

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to