count_up: Count number of unique non-missing observations in a vector

View source: R/count_up.R

count_upR Documentation

Count number of unique non-missing observations in a vector

Description

This function tallies up the number of unique observations within a vector. Input vector can be comprised of any data type

Usage

count_up(x)

Arguments

x

Vector of values to tally up

Value

integer representing number of non-missing values in a vector

Examples

x = 1:10
count_up(x)

x[c(1,5,7)] = NA
count_up(x)

x = sample(1:5, size = 100, replace = T)
count_up(x)

y = x[x != 5]
count_up(y)

Ajfrick/ajfhelpR documentation built on June 30, 2023, 12:56 a.m.