While studying tidyverse, I found something cannot understand. The missing data should be excluded with using na.rm = TRUE , so that calculating 'mean' will return a particular value. However, some gropus reveal NaN instead of a number.
In library 'dplyr', we can use starwars dataset.
starwars |> group_by(species) |> summarise(across(where(is.numeric), mean, na.rm=T))
The results include NaN and I cannot find why this happened