根据ID分隔行

我想分开这个数据框

|    date    |                filters                | filters_values |
+------------+---------------------------------------+----------------+
| 2020-04-01 | filter_float_year,filter_enum_color   | 2020, green    |
| 2020-04-03 | filter_enum_color,filter_float_milage | red, 10000     |
+------------+---------------------------------------+----------------+

要获得这样的结果:

|    date    |       filters       | filters_values |
+------------+---------------------+----------------+
| 2020-04-01 | filter_float_year   | 2020           |
| 2020-04-01 | filter_enum_color   | green          |
| 2020-04-03 | filter_enum_color   | red            |
| 2020-04-03 | filter_float_milage | 10000          |
+------------+---------------------+----------------+

我如何在R中做到这一点?

评论