Why does sum(!is.na(pizza$week)) return the number of rows with valid, non-NA values in the column named week?
The exclamation point in !is.na(pizza$week) reverses the meaning of the test it precedes.
!is.na(pizza$week) counts the number of NA values in the column.
!is.na(pizza$week) counts the number of non-missing values in the column.
!is.na(pizza$week) returns a vector of TRUE/FALSE values, in which TRUE is treated as a 0 and FALSE as a 1.