Write a R program to count the specific value in a given vector.
x = c(10, 20, 30, 20, 20, 25, 9, 26) print("Original Vectors:") print(x) print("Count specific value(20) in above vector:") print(sum(x==20))
Sample Output:
[1] "Original Vectors:" [1] 10 20 30 20 20 25 9 26 [1] "Count specific value(20) in above vector:" [1] 3
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