ntypes: Number of Unique Elements

ntypesR Documentation

Number of Unique Elements

Description

Find the number of unique elements in a vector.

Usage

ntypes (vector) 

Arguments

vector

The vector of interest.

Details

A simple function that converts a vector to a factor, and finds the number of levels. This provides the number of unique elements in a vector, something I find I frequently need.

Author(s)

Santiago Barreda <sbarreda@ucdavis.edu>

Examples

data (pb52)
## the number of unique vowel categories.
ntypes (pb52$vowel)

phonTools documentation built on Nov. 21, 2023, 1:07 a.m.

Related to ntypes in phonTools...