leonL/federal-contributions — pull request #3 by ayakubovich (2014-10-26 16:23:49+00:00)
Title: Normalize names

Created function for normalizing a vector of names in two steps:

I. Cleaning each string
1. convert to all lower
2. convert accented characters (é) to their alphabetical counterparts (
3. drop punctuation marks ("-")
4. replace empty names by 'anon'

II. Splitting it into first name, last name and any remaining characters

Example:

```
names <- d$full_name[c(4,11,94,2470)] #where d is the output of merge_all_parties_and_years.R
names #INPUT
normalize_names(names) #OUTPUT
```

INPUT

| |
-------------
|Charles-Antoine Allain |
|Stéphane Allard |
|Charles E. Beaudoin|

OUTPUT

clean_full_name | last_name | first_name | remaining
------------- | ------------- | ------------- | -------------
charlesantoine allain | allain | charlesantoine |
stephane allard | allard | stephane |
charles e beaudoin | beaudoin | charles | e
anon anon | anon | anon |