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 my_scale() that inputs a numeric vector x and outputs a vector such that:
The output vector contains the min-max 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 0 to 1. 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!