View source: R/harmonic_mean.R
harmonic_mean | R Documentation |
This function calculates the harmonic mean of a numbers vector.
harmonic_mean(x = NULL, learn = FALSE, interactive = FALSE)
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 |
The harmonic mean of the vector (for non-interactive mode)
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.