title: How to split 1 row into multiple rows where columns hold same value types
body: <p>I have a wide dataset which makes it really difficult to manipulate the data in the way I need. It looks like the dummy table below:</p>
  <p><a href="https://i.stack.imgur.com/wmcyn.png" rel="nofollow noreferrer">Dummy_table_unsorted</a></p>
  <p>Essentially, as seen in the table, the information held in 1 row is at a user level, you have a user id and then all the animals owned by each user are in this row. What I would like it, I want this at animal level, so that a user can have multiple entries, which represent each of their different animals. I have pasted a table below of what I would like it to look like:</p>
  <p><a href="https://i.stack.imgur.com/jZD2w.png" rel="nofollow noreferrer">Dummy_table_sorted</a></p>
  <p>Is there a simple way to do this? I have an idea as to how, but it is very long winded. I thought to maybe subset by selected columns relating to one animal only and merge the datasets back together. The problem is, in may data, it is possible for one person to have up to 100 animals, which makes this very long winded.</p>
  <p>Please can someone offer a suggestion or a package/command that would allow me to change this wide dataset into a long one?</p>
  <p>Thank You.</p>