Skip to content
Prev 299431 / 398503 Next

Splitting a character vector.

On Jul 7, 2012, at 5:37 PM, John Kane wrote:

            
data.frame(xx=sub("(\\s\\(.+$)", "", dd1),
            yy=sub("(.+)(\\s\\()(.+)(\\)$)", "\\3", dd1) )
     xx        yy
1  XXY mat harry
2  XXY   jim bob
3 CAMP  joe blow
4  ALP  max jack
David Winsemius, MD
Heritage Laboratories
West Hartford, CT