I am trying to find an R code for normalisation of my values using min and max value for a two column matrix.
My matrix looks like this: Column one (C1) and C2 I.D not
This is a type of non-parametric normalisation, but I would advise you to use another method: calculate the median and interquartile range, subtract the median and divide by the IQR. This will give you a distribution with median 0 and IQR 1.
m <- median( df$C3, na.rm = T )
iqr <- IQR( df$C3, na.rm = T )
df$C3 <- ( df$C3 - m ) / iqr
The method that you propose is extremely sensitive to outliers. If you really want to do it, this is how:
rng <- range( df$C3, na.rm = T )
df$C3 <- ( df$C3 - rng[1] ) / ( rng[2] - rng[1] )