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. ______________________________________________ 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.