I have a data frame which contains a set of keys I want to use in a merging procedure. However, the keys are not correctly structured and the data frame looks like that:
df <- data.frame("Id" = c("a","b","c","d"), "Keys" = c("001","002/004","003","005/006/007"))
Id Keys
1 a 001
2 b 002/004
3 c 003
4 d 005/006/007
I want to extract the keys and restructure them in the following way:
Id Keys
1 a 001
2 b 002
3 b 004
4 c 003
5 d 005
6 d 006
7 d 007
Has-someone encountered and solved this problem ?