n_sparse: An internal function that returns the number of sparse...

Description Usage Arguments Value Note See Also Examples

View source: R/collapse.R

Description

An internal function that returns the number of sparse response categories in a vector v.

Usage

1
n_sparse(v, min_f = 5)

Arguments

v

A vector, usually of self-report items, and usually numeric.

min_f

The threshold for non-sparse frequencies. Any category less than min_f will be flagged as sparse.

Value

The number of sparse responses (i.e., < min_f) in v.

Note

This is intended as an internal function to the collapse() function. Use with care for other purposes.

See Also

collapse()

n_resp_cats()

Examples

1
2
3
4
5
6
7
## Not run: 

sparse_vector <- c(1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6)
n_sparse(sparse_vector)


## End(Not run)

jameswgriffith/jamie documentation built on Dec. 20, 2021, 9:03 p.m.