Question: In R, write a generic function tran and a set of methods so that tran(x, a, b) replaces every instance of the values a in
In R, write a generic function tran and a set of methods so that tran(x, a, b) replaces every instance of the values a in x with b. e.g. tran(c(1, 2, 2,), 2, 3) should be return the vector 1, 3, 3. The function should work with numeric, character, and factor objects and should return an object of the same type.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
