This video explains how to count unique values in the R programming language. More information: https://statisticsglobe.com/r-frequen...
##### Example data
x <- c(3, 1, 4, 3, 1, 2, 1, 5) # Create example data
##### Example 1
table(x) # Apply table function
##### Example 2
as.data.frame(table(x)) # Different representation
##### Example 3
aggregate(data.frame(count = x), # Apply aggregate function
list(value = x),
length)