I\'d like to strip this column so that it just shows last name - if there is a comma I\'d like to remove the comma and anything after it. I have data column that is a mix of
You could use gsub() and some regex:
> x <- 'Day, Bobby Jean' > gsub("(.*),.*", "\\1", x) [1] "Day"