Write a R program to list the distinct values in a vector from a given vector.
v = c(10, 10, 10, 20, 30, 40, 40, 40, 50) print("Original vector:") print(v) print("Distinct values of the said vector:") print(unique(v))
Sample Output:
[1] "Original vector:" [1] 10 10 10 20 30 40 40 40 50 [1] "Distinct values of the said vector:" [1] 10 20 30 40 50
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer