I'm trying to count the # of 0's in each column in my zoo [...dataframe?], similar to how I count the # of na's.
dropColumns = sapply(test1_z, function(x) sum(is.na(x)))
I've tried
View(sapply(test1_z, function(x) count(x[x==0])))
but count doesn't like zoo objects (test1_z). Length works here, but not count.
Any ideas would be greatly appreciated
My professor recommended
sum(frd$col0 == 0)
but that only works for a single column. I was hoping to do this over an entire dataframe.