hadley/plyr — pull request #128 by crowding (2013-03-09 04:35:29+00:00)
Title: join and match_df don't match string to factor

```bash
dfF <- data.frame(character=c("Aeryn", "Jothee", "Jothee", "Chiana", "Scorpius", "Scorpius"),
species=c("Sebacian", "Luxan", "Sebacian", "Nibari", "Sebacian", "Scarran"))
dfS <- colwise(as.character)(dfF)

matchF <- data.frame(species="Sebacian", stringsAsFactors=TRUE)
matchS <- colwise(as.character)(matchF)

#"merge" matches strings to factors both directions
merge(dfF, matchS) #matches
merge(dfS, matchF) #matches

#as does '=='
dfF$species == matchS$species #matches
dfS$species == matchF$species #matches

#`match_df` doesn't match a string to a factor
match_df(dfF, matchF) #matches (despite having different level sets)
match_df(dfF, matchS) #matches string to factor
match_df(dfS, matchS) #matches string to string
match_df(dfS, matchF) #NO MATCHES for factor to string

#nor does `join`, (so inner joins are not commutative)
join(dfF, matchS, type="inner") #matches
join(dfS, matchF, type="inner") #NO MATCHES
```

I think this is a bug since `match_df` is supposed to match like `==` and we expect inner joins to be commutative up to an ordering.