I\'m working in R.
I have a dataset in which some records contain a list of cities and counties instead of just one city or county. I\'m looking for a way to transpose
You can use the function colsplit in package reshape2:
colsplit
reshape2
x <- c("a, b", "c, d", "e") library(reshape2) colsplit(x, ",", names=c("City", "County")) City County 1 a b 2 c d 3 e