powered by
This function calculates the geometric 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.
geometric_mean(x = NULL, learn = FALSE, interactive = FALSE)
The geometric mean of the vector (for non-interactive mode)
Optional numeric vector (not needed for interactive mode)
Logical, if TRUE shows step-by-step explanation
Logical, if TRUE enables interactive practice mode
data <- c(5,21,12,7,3,9,1) # Simple calculation geometric_mean(data) # Learning mode geometric_mean(data, learn = TRUE) # Interactive mode if(interactive()){ geometric_mean(interactive = TRUE) }
Run the code above in your browser using DataLab