Hi,

I have a list called "spec" in which a variable "foundOK" indicates whether or not the given element contains data and must be processed. I have to split the list and process only the good elements, and do something different later on with the bad elements. The code below works. However, is there a way to do the same thing using split(), which IMO would be more elegant?

  foundOK <- which(lapply(spec, function(f) f$foundOK) == TRUE)
  foundFail <- which(lapply(spec, function(f) f$foundOK) == FALSE)
  resFOK <- spec[foundOK]
  resFFail <- spec[foundFail]

Best,
-Michael

	[[alternative HTML version deleted]]

