title: Converting data between long and wide format using Tidyverse and without
body: <p>I'm trying to convert from wide format into long format, but can't find good result. The point is that i need to make it in two ways- using packet Tidyverse, and without it, while i have problems with one way.</p>
  
  <p>that is my data frame:</p>
  
  <pre><code>df2 &lt;- data.frame(name = c("John", "Anna", "Jonte"),
                Matematyka = c(2, 3, 5),
                Polski = c(5, 5, 4)) 
  </code></pre>
  
  <p>and i need to convert the data frame into this:</p>
  
  <pre><code> name subject mark
  1 John math 2
  2 Anna math 3
  3 Jonte math 5
  4 John eng 5
  5 Anna eng 5
  6 Jonte eng 4 
  </code></pre>
  
  <p>i have something like this, but it have some errors (look down)</p>
  
  <p><code>reshape(df2, direction="long", varying = list(names(df2)[2:3]), v.names =list ("subject","mark"),
          idvar = "name")</code></p>
  
  <p>but its only in one way... I need to make it using tidyverse and without tidyverse package, any ideas?</p>
  
  <pre><code> Error in min(j) : invalid 'type' (list) of argument
  </code></pre>