Descriptive Statistics

Summarise your data with means, standard deviations, and grouped summaries.

Run the setup chunk first — it creates the dataset used in all examples below.

Basic statistics

Single-value summaries of a numeric vector. Always print with cat().

summarise( )

Compute multiple statistics at once and return them as a tibble.

group_by( ) + summarise( )

Repeat the summary for each level of a grouping variable.

count( )

Count the number of rows in each group — shorthand for group_by() %>% summarise(n = n()).

IQR and quantiles

Useful for identifying spread and outliers in assay data.

NoteCoding convention — store then print

Compute statistics at full precision, then round only inside cat() when reporting. Never round inside summarise() if the values will be used in further calculations.