Question: Write a function called my _ scale ( ) that inputs a numeric vector x and outputs a vector such that: The output vector contains
Write a function called myscale that inputs a numeric vector x and outputs a vector such that:
The output vector contains the minmax scaled values of the input vector.
The output object contains additional attributes called a and b that contain, respectively, the original
minimum and maximum of the input vector.
If the input vector does not contain both attributes a and b the output vector should be scaled to the
range from to If the input vector contains both attributes a and b the output vector should be
scaled to the range from a to b
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
