DT = data.table(A=5:1,B=letters[5:1])
setkey(DT,B) # re-orders table and marks it sorted.
DT[J("b")] # returns the 2nd row
DT[.("b")] # same. Style of package plyr.
DT[list("b")] # same
Run the code above in your browser using DataLab