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

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

php - Boolean search on database with 5 million rows, very slow -

css - Text drops down with smaller window -