Is there any function in R which can reshape the data in stacked format by merging two dataframes?
Table1
Vegetables|Onion|Potato|Tomato|
Cheap     |  20 |  30  |  40  |
Table2
Vegetables|Cabbage|Carrot|Cauliflower|Eggplant
Mid       |  20   |  30  |     40    |   30
Required Output
   Vegetables |  Type     |Quantity|
    Cheap     |  Onion    |   20   |
    Cheap     |  Potato   |   30   |
    Cheap     |  Tomato   |   40   |
    Mid       |  Cabbage  |   20   |
    Mid       |  Carrot   |   30   |
    Mid       |Cauliflower|   40   |
    Mid       |  Eggplant |   30   |
Thanks in advance for your help! you are awesome.
 
    