Learn R Programming

UAHDataScienceSF (version 1.0.0)

percentile: Percentile Function

Description

This function calculates the percentiles of a numeric vector.

Usage

percentile(x = NULL, p = NULL, learn = FALSE, interactive = FALSE)

Value

The percentile value (for non-interactive mode)

Arguments

x

Optional numeric vector (not needed for interactive mode)

p

Numeric value between 0 and 1 for percentile calculation (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(1,4,3,3,2,5,7,12)

# Simple calculation
percentile(data, 0.3)

percentile(data, 0.3, learn = TRUE)

if(interactive()){
percentile(interactive = TRUE)
}

Run the code above in your browser using DataLab