I have seen those solutions:
However the method is not able to work if there are NA values present.
I have try this:
s = append(sort(rexp(100)),rep(NA,30))
o = data.frame(s,s)
range01 <- function(x){
if (!is.na(x))
{
return(NA)
}
else{
y = (x-min(x))/(max(x)-min(x))
return(y)}
}
xo = apply(o,MARGIN = 2, FUN = range01)
But it doesn't work... Suggestions?
The solution should works on dataframes by apply function