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

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 Databases Questions!