0

I have a dataset in which one of the columns contains a library of different 'subcolumns'. For data preparation purposes, I want to extract certain parts of that column and store it into a new column. The data looks like this:

ss of image 1

I'm looking to get a new, third, column that contains a header that says 'animal' and contains rows that say 'dog' and 'cat'. Like this:

ss of image 2

I usually work with , and the library seems the right solution, but no success so far. I'm also familiar with by the way. Anyone that can be of help?

Thanks in advance!

Cristian E. Nuno
  • 2,822
  • 2
  • 19
  • 33
Michiel Aarts
  • 63
  • 2
  • 7
  • Search SO for answers in your preferred language dealing with key:value pairs. The close votes probably relate to the lack of a [MCVE] in a for that can be converted to code easily. There is great annoyance on SO when data is presented as a picture. It implies that you think we should redo _your_ data entry. – IRTFM Oct 11 '18 at 22:22
  • Hi Michiel. Could you please post your original data frame (or a subset of it) using `dput` to make this a minimally reproducible example? The solution will depend quite a bit on exactly how that input data is formatted and escaped. thanks :) – mysteRious Oct 12 '18 at 00:52

0 Answers0