In this section, we will compare the code side by side to solve the same problem using both default `R`

and `plyr`

. Reusing the `iris3`

data, we are now interested in producing five-number summary statistics for each variable group by species. The five numbers will be minimum, mean, median, maximum, and standard deviation. The output will be a list of data frames.

To calculate the five-number summary statistics, follow these steps:

- Define a function that will calculate five-number summary statistics for a given vector.
- Produce the output of this function in a data frame object.
- Apply this function in the
`iris3`

dataset using a`for`

loop. - Apply the same function using the
`apply()`

function of the`plyr`

package.

An example that explains ...

Start Free Trial

No credit card required