I have a dataframe with lines of text that look like the following:
ANTALYA (GB) ch. 1960
SHOOTIN WAR (USA) ch. 1998
LORD AT WAR (ARG) ch. 1980
The all caps are names, then location in (), color abbreviation, year. Names can be multiple words. I want to separate this single block of text into each component: Name, location, color, year. I have been fighting with this for several days, and the best working solution I have is to just put every word into separate columns, but it only works if the names are all a certain length... For what I'm doing with the data, I can use it in this form but it just doesn't look nice, you know?
sepdf <- df %>%
separate(pedigree, into=c("Name1", "Name2", "Loc", "Col", "Year"),
sep=" ", merge=TRUE)
I tried just keeping the name by using the "(" as a separator between 2 columns, but I don't think R likes that I'm trying to use a parentheses as a delimiter...
Any suggestions would be much, much appreciated.