Assume we define and preprocess a character vector as such:
nameAlpha<-c("Mark Twain", NA, "Phil Hall",
"Michael P. O'Connor", " ", "", NA, "John")
nameAlpha[which(nchar(nameAlpha)<2)]<-NA
You should write
sapply(strsplit(nameAlpha, "\\s+"), head, n=1)
And it will work. If you want the last name you can do
sapply(strsplit(nameAlpha, "\\s+"), tail, n=1)
which will provide you with the vector of last names.