How can I identify and remove entries in a list that are empty, but aren't NA or NULL. Why does my list appear to be a factor when I try to compare its elements?
> s <- subset(world, (oil == "Yes") & !is.na(effectiveness) & !is.null(effectiveness), select = effectiveness)
> s
effectiveness
3 32.62411409517834
30 31.91489350429382
41
54 23.8770690651932
64 35.93380642839076
80 33.3333332769696
81 35.6973993299137
116 50.118203450602
131 20.09456253502668
181
194 19.62174974716583
> typeof(s)
[1] "list"
> sum(s)
Error in FUN(X[[1L]], ...) :
only defined on a data frame with all numeric variables
> s[s > 0]
[1] NA NA NA NA NA NA NA NA NA NA NA
Warning message:
In Ops.factor(left, right) : > not meaningful for factors