harmonic_mean {UAHDataScienceSF} | R Documentation |
Harmonic Mean Function
Description
This function calculates the harmonic mean of a numbers vector.
Usage
harmonic_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 harmonic mean of the vector (for non-interactive mode)
Examples
data <- c(1,4,3,3,2,5,7,12,1,2,3,12)
# Simple calculation
harmonic_mean(data)
# Learning mode
harmonic_mean(data, learn = TRUE)
# Interactive mode
if(interactive()){
harmonic_mean(interactive = TRUE)
}
[Package UAHDataScienceSF version 1.0.0 Index]