Why I get NaN out after sapply

83 Views Asked by At

I have data which looks like:

datas <- as.matrix(rnorm(100, mean=90, sd=5)) 

Then, I tried to transform with:

sapply(datas, function(x) {(x-min(x))/((max(x)-min(x)))})

I get NaN.

Any help would be appreciated.

0

There are 0 best solutions below