count_digits: Counts number of times each digit occurs

View source: R/count_digits.R

count_digitsR Documentation

Counts number of times each digit occurs

Description

The 'count_digits()' function takes a numeric column of a data frame and counts the number of times that each digit occurs in the first decimal place.

Usage

count_digits(data, variable, group = NULL, decimal_place = 1)

Arguments

data

A data frame

variable

A numeric variable that includes the first decimal place.

group

A second variable used to group the primary variable such that average frequency is calculated separately for each group.

decimal_place

The decimal place for which digits are counted. The default is set to one but any place may be specified by numeric rank, i.e. "1" for the 1st decimal (tenths), "2" for the 2nd decimal (hundreds), etc.

Value

A tibble

Examples

count_digits(simulated_normal, obs, group)


josh-mc/fabricated documentation built on April 25, 2022, 1:31 p.m.