The H and T values come form the same recording so the gaps that require filling in H are the same as those in T. Therefore the lists will never be of unequal lengths and I can abstract the list to an array using array(unlist(H)) which is a lot simpler. My fault for not clarifying!
Finally, the actually dataset that needs filled will have multiple gaps like the one below: H <- c(0.88, 0.72, 0.89, 0.93, 1.23, 0.86, 0.98, 0.85, 1.23) T <- c(7.14, 7.14, 7.49, 8.14, 7.14, 7.32, 7.14, 7.14, 7.14) O <- c(0, 0, 0, 2, 0, 0, 0, 2, 0) Can you advise how to create multiple input lists from this so that I can incorporate that into the function that you defined? Thanks, Doug -- View this message in context: http://r.789695.n4.nabble.com/Data-Gaps-tp2993317p2995263.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list 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.