title: How to convert a Multi-dimensional data.frame to one-dimensional data.frame in R
body: <p>I have a Multi-dimensional data.frame like this:<br />
  <code>df1</code></p>
  <pre><code>   site   date   2019-01-01   2019-01-01 2019-01-01 2019-01-02  2019-01-02 2019-01-02 2019-01-03 ...    
            types     PM2.5        O3         NO2        PM2.5       O3          NO2       PM2.5
  #1 1001A              1           1          1           1          1           1          1 
  #2 1002A              1           1          1           1          1           1          1 
  #3 1003A              1           1          1           1          1           1          1 
      ...
  </code></pre>
  <p>My desired output would be:</p>
  <pre><code>      site   date        type   value
  #1   1001A   2019-01-01  PM2.5   1
  #2   1001A   2019-01-01   O3     1
  #3   1001A   2019-01-01   NO2    1
  #4   1001A   2019-01-02  PM2.5   1      
  #5   1001A   2019-01-02   O3     1
  #6   1001A   2019-01-02   NO2    1
               ....
  #n+1 1002A   2019-01-01  PM2.5   1
  #n+2 1002A   2019-01-01   O3     1
  #n+3 1002A   2019-01-01   NO2    1
  #n+4 1002A   2019-01-02  PM2.5   1      
  #n+5 1002A   2019-01-02   O3     1
  #n+6 1002A   2019-01-02   NO2    1
               ....
  </code></pre>
  <p>How should I deal with it<br />
  Many thanks!!!</p>