I am struggling to understand the purpose of the summarize function in summary statistics. Here is the question I am on:

https://www.codecademy.com/courses/learn-r/lessons/r-aggregates/exercises/column-statistics

Why does this code find the maximum value of the “price” column

**most_expensive ← orders %>%**

**summarize(maximum = max(price, na.rm = TRUE))**

instead of :

**most_expensive ← orders %>%**

**max(summarize(price, na.rm = TRUE))**

If summarize() turns the column into a vector, why is the maximum function performed on the column instead of the vector?

Thank you!

I’ve been trying to puzzle this out for days.