[R] Average of several line plots

Philipp Pagel p.pagel at wzw.tum.de
Thu Feb 3 12:12:15 CET 2011


On Thu, Feb 03, 2011 at 01:36:57AM -0800, mattnixon wrote:
> 
> 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?

I am not 100% sure, but if I understand your problem correctly,
loess() may be applicable.

cu
	Philipp

-- 
Dr. Philipp Pagel
Lehrstuhl für Genomorientierte Bioinformatik
Technische Universität München
Wissenschaftszentrum Weihenstephan
Maximus-von-Imhof-Forum 3
85354 Freising, Germany
http://webclu.bio.wzw.tum.de/~pagel/



More information about the R-help mailing list