powered by
lunique returns the number of non-NA unique elements and lna returns the number of NAs.
lunique
NA
lna
lunique(x)lna(x)
lna(x)
A non-negative integer.
A vector.
length(), unique(), is.na()
length()
unique()
is.na()
x <- sample(c(1:3, NA), 10, replace = TRUE) lunique(x) lna(x)
Run the code above in your browser using DataLab