Hi,
A quick way to do it is creating a table between pairs of genotypes.
i <- which(indNames(gl)==”ind1”)
j <- which(indNames(gl)=”ind2”)
tt <- table(as.matrix(gl[i,]), as.matrix(gl[j,], useNA=”always”)
tt
sum(diag(tt))/sum(tt)
This creates a confusion table between the individual i and j. on the diagonal you find the numbers genotypes 0,1,2 are matching, off the diagonal the not matching genotypes.
We should create a function that does all pairs provided. (as I use it quite a lot). I have also a function that calculates the error rate for repeated genotypes if you are interested.
Cheers, Bernd
Ps. If you copy the code above make sure you replace the quotes but straight ones.
From: da...@googlegroups.com <da...@googlegroups.com>
On Behalf Of Kndalem Yaregal
Sent: Thursday, 18 September 2025 3:41 PM
To: da...@googlegroups.com
Subject: [dartR] request support
You don't often get email from knda...@gmail.com. Learn why this is important |
--
You received this message because you are subscribed to the Google Groups "dartR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
dartr+un...@googlegroups.com.
To view this discussion visit
https://groups.google.com/d/msgid/dartr/CAHoS5_SeMvBBRs8-JvhsJQEmi0N5Ws53XoWCKkYgKBCstm%3DsJQ%40mail.gmail.com.
To view this discussion visit https://groups.google.com/d/msgid/dartr/ME3PR01MB794420C5F025386CBE5930D0D411A%40ME3PR01MB7944.ausprd01.prod.outlook.com.