I see a few getting confused between the quartiles given by summary() and fivenum().
Firstly - summary() gives the following summary statistics:
[Minimum] [1st Quartile] [Median] [Mean] [3rd Quartile] [Maximum]
fivenum() returns Tukey's five number summary i.e.
[Minimum] [Lower hinge] [Median] [Upper hinge] [Maximum]
Here comes the confusion - what's the difference between the quartiles and lower/upper hinges?
Let me explain with an example - Try this in R:
First - with a vector "y" of odd number of values (5 in this example)
> y=c(2, 5, 8, 15, 8)
> summary(y) Min. 1st Qu. Median Mean 3rd Qu. Max.
> 2.0 5.0 8.0 7.6 8.0 15.0
>  2 5 8 8 15
As you can see results are the same, except that summary() gave the mean value in addition to what fivenum() displayed.
Now I am including just one more variable (new value: 12) and defined this vector as "z"; Note that the vector count is now even (6 values)
> z=c(2, 5, 8, 12, 15, 18)
Min. 1st Qu. Median Mean 3rd Qu. Max.
2.00 5.75 10.00 10.00 14.25 18.00
 2 5 10 15 18
Now see the difference - while summary() gave you the quartiles (calculated values based on quartile or percentile formulae), this is what fivenum() does - making it really simple - you can do it without math calculations:
Description of fivenum() output:
Firstly, min, median & max values given by fivenum() are straight
Lower Hinge = median of the values to the left of (MEDIAN OF ALL
VALUES) = median of the values that are less than 10 = median of
(2,5,8) = 5
Upper hinge = median of the values to the right of (MEDIAN OF ALL
VALUES) = median of the values that are greater than 10 = median of
(12,15,18) = 15