行列で計算するならこんなだろうか。
x<-floor(runif(10000, min=-10, max=10+1))
y<-matrix(x,ncol=10)
z <- cbind(y, apply(y, 1, function(a) sum(a[a>=0])+sum(a[a<0])))