I know that sum(NA, na.rm = TRUE) results in 0. However, I wouldn't necessarily want this 0 to appear in a summarise() output. Please see the minimal example below.
Subsequent calculations using the tot column would be wrong (e.g., mean of tot). I know this is a symptom of the sum() function, but was wondering if there is a "safer" way of doing such summarize? I suppose one approach is an initial test, e.g.,
for accurate downstream calculations, simple use the NA , as there purpose of existence is to work in the way you would require.
Displaying nicely formatted results for users should happen downstream of your calculations; you can decide on appropriate way to print the NA info depending on that.