Is there possibly a way to turn this data...
Month Animal Number CodeName
8-9 cat 2 whiskers
3-4 cat|dog 1|4 whiskers|spot
10-11 elephant 5 trunks
7-8 cat|snake 3|2 whiskers|thomas
5-6 elephant|dog 0|7 trunks|spot
In to this...
Month Animal Number CodeName
8-9 cat 2 whiskers
3-4 cat 1 whiskers
3-4 dog 4 spot
10-11 elephant 5 trunks
7-8 cat 3 whiskers
7-8 snake 2 thomas
5-6 elephant 0 trunks
5-6 dog 7 spot
By breaking up the pipe?
I would be keeping the Month column the same, but the Animal, Number, and CodeName pipe columns would be split.
The last code that I tried for this was...
df %>% separate_rows(., Animal, Number, CodeName, convert = TRUE)
But I received the error of "Incompatible lengths".
Any help would be greatly appreciated