Counting the number of elements with the values of x in a vector
You can just use table(): > a <- table(numbers) > a numbers 4 5 23 34 43 54 56 65 67 324 435 453 456 567 657 2 1 2 2 1 1 2 1 2 1 3 1 1 1 1 Then you can subset it: > a[names(a)==435] 435 3 Or convert it into … Read more