[R] Post: R-help : help with loops

Efres B efresbr at hotmail.com
Sat Mar 5 16:31:01 CET 2016


Hello.

 

Im trying to post the following message in R-Help. 

 

I think I must send it via email to do so, so here it is:

 

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.

 

Thanks.

 


	[[alternative HTML version deleted]]



More information about the R-help mailing list