r - Reduce List but avoid Null variables -
given list null element:
l<-list(x=1,b=2,c=null)
how can reduce list using '+' addition avoid adding null value? tried
reduce(l,"+",null.rm=t)
but don't think got null.rm. efficient way of solving this?
thanks
you can exclude null elements with:
l[!unlist(lapply(l, is.null))]
is want?
cheers
Comments
Post a Comment