Skip to content
Prev 31521 / 398506 Next

Creating Dummy Variables with if else phrase

On Friday 02 May 2003 21:41, langensk at fas.harvard.edu wrote:

            
I don't really understand why you want to create a matrix that way, 
but if you want to do it the way described above
  is.real(x[i])
seems to be the wrong function (because x is a real vector in the 
example above). If you want to test for NA you should use
  !is.na(x[i])
instead.
Z