Learn R Programming

quickcode (version 1.0.6)

unique_len: Combine unique() and length()

Description

Combine two frequently used function together to return the length of the unique items of a vector

Usage

unique_len(.)

Value

length of the unique items in a vector

Arguments

.

object such as vector or names(dataframe)

Examples

Run this code
frenchnames1 = c("Léa","Obinna","Bastien","Léa","Obinna", "Hugo", "Amélie","Louis")
unique_len(frenchnames1)

Run the code above in your browser using DataLab