rn=c(3,4,5,2,1,5,6,8,10,3,4,5,6,8,9,7)
na=c("A","A","A","A","A","B","B","B","B","B","CD","CD","CD","CD","CD","CD")
mo=c("ram","okd","mlu","lom","mpl","mpl","cdd","jjh","yyt","uu","tt","rre","llm","mm","mlp","lok")
dat=cbind(rn,na,mo)
I need to select for each group in na the lowest number in rn
example output:
"1" "A" "mpl"
"3" "B" "uu"
"4" "CD" "tt"