I want to calculate the mean of a list of named numbers. There are numeric(0) values that I first want to remove. Also, I would like to retrieve which elements of
numeric(0)
Another solution using the Filter function from base R:
mean(unlist(Filter(is.numeric, l)))