Learn R Programming

UAHDataScienceSF (version 1.0.0)

average_deviation: Average Absolute Deviation Function

Description

This function calculates the average absolute deviation of a numbers vector.

Usage

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

Value

The average absolute deviation of the vector (for non-interactive mode)

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

Examples

Run this code
data <- c(7,2,5,7,1,4,12)

# Simple calculation
average_deviation(data)

# Learning mode
average_deviation(data, learn = TRUE)

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

Run the code above in your browser using DataLab