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

Arunkumar Srinivasan aragorn168b at gmail.com
Sat Mar 5 13:03:40 CET 2016


This is the mailing list for data.table package. Please ask again on the r-help list.

-- 
Arun

On 5 March 2016 at 13:00:56, Alice Cooper (efresbr at gmail.com) wrote:

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.
_______________________________________________
datatable-help mailing list
datatable-help at lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20160305/6148d881/attachment.html>


More information about the datatable-help mailing list