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

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -