I have a dataframe in which I want to use certain values as hash keys / dictionary keys (or whatever you call it in your language of choice) for other values in that dataframe. Say I have a dataframe like this which I've read in from a large csv file (only first row shown):
Plate.name QN.number Well Allele.X.Rn Allele.Y.Rn Call
1 Plate 1_A1 QN2200 A 1.766 2.791 Both
which in R code would be:
structure(list(Plate.name = structure(1L, .Label = "Plate 1_A1", class = "factor"),
QN.number = structure(1L, .Label = "QN2200", class = "factor"),
Well = structure(1L, .Label = "A1", class = "factor"), Allele.X.Rn = 1.766,
Allele.Y.Rn = 2.791, Call = structure(1L, .Label = "Both", class = "factor")), .Names = c("Plate.name",
"QN.number", "Well", "Allele.X.Rn", "Allele.Y.Rn", "Call"), class = "data.frame", row.names = c(NA,
-1L))
THe QN.numbers are unique IDs in my dataset. How do I then retrieve data using the QN.number as a reference for the other values, that is to say I want to know the Call or the Allele.X.Rn for a given QN.number? It seems row.names might do the trick but then how would I use them in this instance?