mean_: Statistical Mean Function

View source: R/mean.R

mean_R Documentation

Statistical Mean Function

Description

This function calculates the arithmetic mean of a numeric vector. Can be used in three modes: simple calculation, learning mode with step-by-step explanation, or interactive mode for practice.

Usage

mean_(x = NULL, learn = FALSE, interactive = FALSE)

Arguments

x

Optional numeric vector (not needed for interactive mode)

learn

Logical, if TRUE shows step-by-step explanation

interactive

Logical, if TRUE enables interactive practice mode

Value

The arithmetic mean of the vector

Examples

# Simple calculation
data <- c(1,2,2,5,10,4,2)
mean_(data)

# Learning mode
mean_(data, learn = TRUE)

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


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