search for: ferrazlab

Displaying 1 result from an estimated 1 matches for "ferrazlab".

2012 Nov 08
4
Accessing selected elements of a list
Hi, If I have a vector: junk <- c(2,0,0,3,0) and want to access, say, all the elements that are greater than zero. I just do: junk[which(junk>0)] Now, If I have a list: jlist <- list(NULL,c(1,0),NULL,c(1,2,3), NULL) and want to access all the elements that have length greater than zero, I know how to find the elements with: which(sapply(jlist,length)>0) But how do I get a