Learn R Programming

fmsb (version 0.7.6)

percentile: Convert numeric vector into its percentile

Description

Convert numeric vector into its percentile. For example, 1:5 will become c(0,25,50,75,100).

Usage

percentile(dat)

Value

A integer vector in [0,100]. Minimum value always becomes 0 and maximum always becomes 100.

Arguments

dat

A numeric vector, which will be converted into percentile value.

Examples

Run this code
 percentile(1:5)
 X <- runif(1000, 10, 20)
 percentile(X)

Run the code above in your browser using DataLab