xxxxxxxxxx
words <- 'Albert Einstein went to the store and saw his friend Nikola Tesla'
# split to vector of individual words
vec <- unlist(strsplit(words, ' '))
# just the capitalized ones
caps <- grep('^[A-Z]', vec, value = T)
# assemble back to a single string, if you want
paste(caps, collapse=' ')
xxxxxxxxxx
x <- "if Albert Einstein didn't see his friend Nikola Tesla leavin'"
gsub("\\b[a-z][^ ]*(\\s+)?", "", x)
# [1] "Albert Einstein Nikola Tesla "