[R] R: Why this deosn't work?, matrix, rounding error?

skan juanpide at gmail.com
Fri Oct 8 17:27:34 CEST 2010


Hello

Why this works:
ncota <- 1
nslope <- 29
resul <- matrix(rep(0,ncota*nslope*4),ncota*nslope,4)



But this doesn't?
ncota <- 1
sini <- 0.1; sfin <- 1.5; spaso <- 0.05; nslope <- 1+((sfin-sini)/spaso)
resul <- matrix(rep(0,ncota*nslope*4),ncota*nslope,4)


I guess the problem is that the division gives a noninteger number.
How can I get the second one work?
I need to create a zero matrix with its size calculated from a calculation.

cheers
-- 
View this message in context: http://r.789695.n4.nabble.com/R-Why-this-deosn-t-work-matrix-rounding-error-tp2968527p2968527.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list