Skip to contents

This function calculates the percentile of a given value in a dataset using one of three methods: "a", "b", or "c".

Usage

percentile(data, x, method = "c")

Arguments

data

A numeric vector representing the dataset.

x

The value for which to calculate the percentile.

method

The method to use for calculating the percentile. Options are "a", "b", or "c". Defaults to "c".

Value

The percentile of the value in the dataset.

Examples

data <- c(1, 2, 3, 4, 5)
percentile(data, 3, method = "c")
#> [1] 50