Candidates.getByLevenshtein(lastName, electionYear=NULL)
# First, make sure your personal PVS API key is saved as character string in the pvs.key variable:
pvs.key <- "yourkey"
# get candidates with similar last names
names <- Candidates.getByLevenshtein(list("Obama","Romney"),2012)
names
Run the code above in your browser using DataLab