absolute_frequency: Absolute Frequency Function

View source: R/absolute_frequency.R

absolute_frequencyR Documentation

Absolute Frequency Function

Description

This function calculates the absolute frequency of a value in a numeric vector.

Usage

absolute_frequency(v = NULL, x = NULL, learn = FALSE, interactive = FALSE)

Arguments

v

Optional numeric vector (not needed for interactive mode)

x

Optional numeric value to count (not needed for interactive mode)

learn

Logical, if TRUE shows step-by-step explanation

interactive

Logical, if TRUE enables interactive practice mode

Value

The absolute frequency of x in v (for non-interactive mode)

Examples

data <- c(1,4,3,3,2,5,7,12,1,2,3,12)
value <- 12

# Simple calculation
absolute_frequency(data, value)

# Learning mode
absolute_frequency(data, value, learn = TRUE)

# Interactive mode
if(interactive()){
absolute_frequency(interactive = TRUE)
}


UAHDataScienceSF documentation built on April 3, 2025, 10:44 p.m.