title: How to create a pivot table in R with multiple rows and one column
body: <p>Hey guys I am trying to build a pivot table in R which I just started using. I know this topic has been discussed a few times here but I can't find an example that would help me out. I have data table which looks like following
  <a href="https://i.stack.imgur.com/UIYlp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UIYlp.png" alt="enter image description here" /></a></p>
  <p>What I am trying to do is build a triangle with Years as columns. Country &amp; City as rows. So it looks like this</p>
  <p><a href="https://i.stack.imgur.com/8nxMH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8nxMH.png" alt="enter image description here" /></a></p>
  <p>I have tried using group_by but can't figure it out. Would really appreciate any advice I can get!</p>
  <p>Thanks in advance</p>