Skip to content
Back to formatted view

Raw Message

Message-ID: <50978D9F.6010202@sunrise.ch>
Date: 2012-11-05T09:57:51Z
From: Christian Schulz
Subject: division giving spurious NA

Hi,

I stumbled acros the following disturbing computation:

x <- matrix(c( 
2.594028,0.8468867,NA,2.244600,1.215535,0.8233032,NA,3.176697,3.425393,2.5345225,NA,3.247219),nrow=3,byrow=TRUE)
x  # having NA in column3 only

x[1:2,]/x[3,]
##           [,1]     [,2] [,3]      [,4]
[1,] 0.7572935       NA   NA        NA
[2,] 0.4795913 0.253541   NA 0.9782823

where do the two Nas in columns 2 and 4 come from?

TIA

Christian

-- 
Christian W. Hoffmann,
CH - 8915 Hausen am Albis, Switzerland
Rigiblickstrasse 15 b, Tel.+41-44-7640853
c-w.hoffmann at sunrise.ch,
christian at echoffmann.ch,
www.echoffmann.ch