Hi, Peter: thank you, I have taken a look at ?approxfun but I'm not sure it does what I'm after.
Eduardo: The data doesn't represent functions. Basically the X values represent the distance across a sample and the Y values are a measure of the colour intensity at that point across the sample (i.e. a line plot across the sample). Each data set represents a measurement across a different section of the sample. All data sets show alternating 'light' and 'dark' sections, though the sample isn't perfect so the widths of each section do not entirely match up from one data set to another. The problem comes from the fact that some data sets contain as many as 400 measurements across the sample whereas others contain as few as 150 measurements. This means that measurements do not necessarily occur at the same value of X on different data sets. Therefore I think I need some way to average the lines ('of best fit') that each data set creates on the graph, rather than averaging the data ponits themselfs as I can't see how I can take averages/weighted averages of the data points when they occur at different values of X (and at different intervals) across the sample. Is my description any better this time? -- View this message in context: http://r.789695.n4.nabble.com/Average-of-several-line-plots-tp3254850p3257696.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.