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
Article Tags :