Hi, I want put some values in the last column of a matrix b. But every time again there comes the same error on the screen...
> b <- array(0, c(5,5)) > m<-matrix(runif(20,0,2*pi),5) # the sinus of this kind of values i want put in the last column of b, m is a 5*4 matrix > n<-5 > for(i in 1:n){ + a2<-1 + for(k in 1: n-1){ + a2<-a2*sin(m[i,k]) + } + b[i,n]<-a2 + } Error in b[i, n] <- a2 : replacement has length zero Is there someone who see the problem? Thanks a lot, Frederik [[alternative HTML version deleted]] ______________________________________________ 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.