[R] digits in matrix

Knut Krueger rh at knut-krueger.de
Fri Jan 30 11:20:45 CET 2015


I have a matrix winth integer values after an arithmetic calulation
How can prevent the [1:3]1:3] part of the matrix to be converted to floats


data = matrix(c(1:16),nrow=4,ncol=4) #create matrix
data[4,] = data[4,]/3
data[,4] = data[,4]/3
data


Kind regards Knut



More information about the R-help mailing list