Hi Sean, Thanks for your answer, This solution isn't really working for me,
Sorry I wasn't clear enough in describing the problem
As a first step I simply need to compare 2 columns (with non numeric values) to each other for similarity
For instance comparing
XR_res3with columnXR_res5to check and get a result of mismatch in percents, here I probably need to use some likeall.equalbut can't figure out the syntax.As a step two I need to group data by
Personal_ID's and calculate mismatch per groupso should compare
XR_res3with columnXR_res5for group withPersonal_ID001, thenXR_res3with columnXR_res5for group withPersonal_ID002 and so on,
For that purpose I will build a new data some like:
dt.1<- subset(mydata, select=c("Personal_ID")) dt.2<- subset(mydata, select=c("XR_res3")) dt.3<- subset(mydata, select=c("XR_res5")) dt.x<- cbind(dt.1,dt.2,dt.3)
and my final result should look some like
Personal_ID XR_res3 XR_res5 Mismatch Result
001 pos neg 0.50
001 pos pos
001 neg pos
002 neg pass 1.0
002 neg pass
003 pos pos 0.0
003 pass pass
003 pass pass
003 neg neg
I suppose I should use data.tables [,, by= Personal_ID] but again can't figure out the syntax
Thanks