Question: Using the ifelse() function, write a function that adds 1 to all the positive entries of a vector and subtracts one from all the non-positive
Using the ifelse() function, write a function that adds 1 to all the positive entries of a vector and subtracts one from all the non-positive entries. Test it on 100 randomly generated observations from the N(0,1) distribution, and use the function from the previous problem to create a histogram of the modified sample.
R Programming!!!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
