data(mtcars)
max(mtcars$mpg)
## [1] 33.9
min(mtcars$mpg)
## [1] 10.4
max(mtcars$mpg)-min(mtcars$mpg)
## [1] 23.5
scaled=mtcars$mpg-min(mtcars$mpg)/
  (max(mtcars$mpg)-min(mtcars$mpg))
scaled
##  [1] 20.557447 20.557447 22.357447 20.957447 18.257447 17.657447 13.857447
##  [8] 23.957447 22.357447 18.757447 17.357447 15.957447 16.857447 14.757447
## [15]  9.957447  9.957447 14.257447 31.957447 29.957447 33.457447 21.057447
## [22] 15.057447 14.757447 12.857447 18.757447 26.857447 25.557447 29.957447
## [29] 15.357447 19.257447 14.557447 20.957447
mtcars$mpg
##  [1] 21.0 21.0 22.8 21.4 18.7 18.1 14.3 24.4 22.8 19.2 17.8 16.4 17.3 15.2
## [15] 10.4 10.4 14.7 32.4 30.4 33.9 21.5 15.5 15.2 13.3 19.2 27.3 26.0 30.4
## [29] 15.8 19.7 15.0 21.4
a=cbind(scaled,mtcars$mpg)
plot(a)