0

My data frame

DEALER ZIP
A      95605, 95811, ...
B      93291, 93277, ...

Since the ZIP column has more than one zip, I need this data cleaned so each zip gets its own row and the dealer for that row is still the one associated with it before the data was elongated.

Dealer
A  95605
A  95811
...
B  93291
B  93277 

I know this code will split the data in a cell by a comma so that each zip has its own row, but how would I keep the associated Dealer?

unlist(strsplit(ZIP, ","))

0 Answers0