All, I am looking to find the first principal payment date on structured MBS cash flow. I am testing the below to make into a function the correct index is returned. I am a little unsure. Is this the correct way to think about this problem or is there something already in R that can help?
Glenn data <- as.list(c(rep(0, 20), rep(1, 340))) f <- function(x){x != 0} which(sapply(data, f ) == TRUE)[1] [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.