Q:

Write a R program to reverse the order of given vector

0

Write a R program to reverse the order of given vector.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

v = c(0, 10, 10, 10, 20, 30, 40, 40, 40, 50, 60)
print("Original vector-1:")
print(v)
rv = rev(v)
print("The said vector in reverse order:")
print(rv)

Sample Output:

[1] "Original vector-1:"
 [1]  0 10 10 10 20 30 40 40 40 50 60
[1] "The said vector in reverse order:"
 [1] 60 50 40 40 40 30 20 10 10 10  0

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now