I'm relatively new to R. I have a data frame with 939 rows that looks like this:
| cuisine | Number.of.order | Customer_id |
|---|---|---|
| Fastfood | 2 | 1 |
| cakes | 3 | 1 |
| Western | 4 | 2 |
| Chinese | 5 | 3 |
What i want is to get rid of the Numbers.of.order column and add the values inside the column as addition rows.
Something like this:
| cuisine | Customer_id |
|---|---|
| Fastfood | 1 |
| Fastfood | 1 |
| cakes | 1 |
| cakes | 1 |
| cakes | 1 |
| Western | 2 |
| Western | 2 |
| Western | 2 |
| Western | 2 |
| Chinese | 3 |
| Chinese | 3 |
| Chinese | 3 |
| Chinese | 3 |
| Chinese | 3 |
Im doing this so that I can convert it into a transaction dataframe for association rules.
Any help would be greatly appreciated!!