I have a data frame like this:
x=c(\"01\",\"01\",\"01\",\"22\",\"22\",\"03\",\"03\",\"03\",\"35\",\"35\") y=c(\"f\",\"f\",\"f\",\"m\",\"m\",\"m\",\"m\",\"m\"
df <- df[order(df$spn), ] > df[!duplicated(df), ] spn sex 1 01 f 6 03 m 4 22 m 9 35 f