Chapter 3 Summarising data
“The Answer to the Great Question … Of Life, the Universe and Everything … Is … Forty-two,” said Deep Thought, with infinite majesty and calm.
Douglas Adams, The Hitchhiker’s Guide to the Galaxy
In this chapter you will find out how to:
- summarise data using:
group_by()
,summarise()
, andmutate()
; - reshape data between the wide and long formats:
pivot_wider()
andpivot_longer()
; select()
columns andarrange()
(sort) rows.
The exercises at the end of this chapter combine all of the above to give context and show you more worked examples.