[datatable-help] Help with a loop/search/function

Alice Cooper efresbr at gmail.com
Sat Mar 5 12:33:23 CET 2016


Hello,
I need help with some code.
Basically, I have experiments results which I need to process. 

I have 2 dataframes with 3 columns
Df1 <- data.frame (Date, Cellline, Data)
Df2 <- data.frame (Date, Cellline, Control)

I want for the entire column Df1-Data to be subtracted by the corresponding
Df2-Controls which Columns Date and Cellline coincide through some type of
loop.
So the structure is:

Df1$Data <- Df1$Data – Df2$Control [when (Df1$Celline == Df2$Celline &
Df1$Date == Df2$Date])

Each Control has several dozen Data values which are linked through Data and
Celline. Of course, the data.frames are of different dimensions. 

I’ve tried several approaches and failed miserably.
Any suggestions?

Thank you in advance for any.




--
View this message in context: http://r.789695.n4.nabble.com/Help-with-a-loop-search-function-tp4718273.html
Sent from the datatable-help mailing list archive at Nabble.com.


More information about the datatable-help mailing list