I have a list full of of data.frames with two columns, time and signal. The data.frames are the results of GC chromatographic analysis from a process that was periodically sampled.
I want to compare the gc data I've collected.
I've written a function to convert the times and peak areas into percentage areas (excluding solvent peak) and relative retention times.
Due to the nature of the process, different GCs have differing numbers of peaks and therefore comparison isn't straightforward. Impurities appear at different parts of my process and hence give extra peaks.
I want to go over my list and find the longest vector of relative retention times (no problem). I want to use the longest vector as a comparator and place NA values at the relative retention times that appear at the same time as the comparator but do not appear in the other data.frames.
Hence the results of the following list of relative retention times,
prac <- list(a=c(0.203,0.305,0.444,0.780,1.000,1.101,1.403),
b=c(0.201,0.306,0.442,0.778,1.000,1.101,1.208,1.401))
where b is the comparator vector, should look like
0.203 0.305 0.444 0.780 1.000 1.101 NA 1.403
0.201 0.306 0.442 0.778 1.000 1.101 1.208 1.401
Can anyone suggest how I might be able to start?
My first thought was a for loop but I don't think that will work. Please note that there are sometimes more than 1 NA values required.
(I plan to collate the percentage areas against the comparator relative retention times for all the chromatograms, if only I can get beyond this problem).