It is very straightforward to use length(unique(x))/ dplyr::n_distinct(x)/data.table::uniqueN(x) to get the exact number of unique values
length(unique(x))
dplyr::n_distinct(x)
data.table::uniqueN(x)