What happens to missing values in a histogram? What happens to missing values in a bar chart? Why is there a difference?
In geom_histogram(), the missing values are removed.
What does na.rm = TRUE do in mean() and sum()?
If there are missing values in the vector, mean() and sum() will return NA. By including na.rm = TRUE, mean() and sum() will return the average and sum based on the non-missing values in the vector.