Skip to content
Related Articles

Related Articles

Tukey’s Five-number Summary in R Programming – fivenum() function
  • Last Updated : 01 Jul, 2020

fivenum() function in R Language is used to return Tukey’s five-number summary of input data i.e., minimum value, lower-hinge value, median value, upper-hinge value and maximum value of the input data.

Syntax: fivenum(x, na.rm = TRUE)

Parameters:
x: indicates numeric object
na.rm: indicates logical value. If TRUE, NAs and NANs are dropped.

Example 1:




# Create numeric data object
x <- seq(1, 13, by = 2)
  
# Show Tukey's five-number summary
fivenum(x)

Output:

[1]  1  4  7 10 13

Example 2:




# Create numeric data object
x <- rnorm(1000)
  
# Show Tukey's five-number summary
fivenum(x)

Output:

[1] -2.97770299 -0.65995003 -0.04482463  0.70722486  2.99627903
My Personal Notes arrow_drop_up
Recommended Articles
Page :