I am trying to use strsplit to split ordered strings across two variables into rows in a dataset. Each ordered string is separated by , , but I am getting a bit confused and haven't found any similar questions on SO.
Not sure if I am explaining myself right, so see below example data:
df <- data.frame(suburb = c("yellow, blue", "orange, yellow", "blue", "green, yellow"), postcode = c("a9, b9", "c9, a9", "b9", "d9, a9"))
What i would ideally like to get to is something like
suburb postcode
yellow a9
blue b9
orange c9
yellow a9
blue b9
green d9
yellow a9