length_omit_na: Length of an object

View source: R/length_omit_na.R

length_omit_naR Documentation

Length of an object

Description

length_omitna() counts only non-missing elements of a vector.

Usage

length_omit_na(x)

Arguments

x

Input vector. Either a vector, or something coercible to one.

Value

An integer

See Also

length() counts all the elements in a vector including those that are missing (NAs).

Examples


ethnicity <- c("Hausa", NA, "Yoruba", "Igbo", NA, "Fulani", "Kanuri", "Others")

length_omit_na(ethnicity)

length(ethnicity)


forstringr documentation built on Aug. 7, 2023, 5:08 p.m.