[R] How to strip everything after second whitespace?

johannes rara johannesraja at gmail.com
Fri Nov 6 09:11:48 CET 2009


How to split everything after second whitespace char using regular
expression? I want to remove A, B, C and D from these names:

nam <- c("Smith John A", "Smith David B C", "Smith Ryan C D")

Thanks,
Johannes




More information about the R-help mailing list