Question: Submit an R program that allows the user to enter a numeric vector of arbitrary length. Use the runif function to select two random indices
- Submit an R program that allows the user to enter a numeric vector of arbitrary length. Use the runif function to select two random indices of the vector and swap the value at these two indices. You may assume that the entered vector has at least two elements.
An example of the program's execution follows.
Enter a vector of numbers: 4 5 6 8 9 3 2
Swapped vector: 4 5 3 8 9 6 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
