【发布时间】:2021-02-25 19:27:05
【问题描述】:
我有一个数据框,其中每一行都是一个列表。像这样:
> df
recipe_id ingredients
1 c("cheese", "milk")
2 c("egg", "chocolate")
3 c("rice", "corn")
我想把它变成:
> df
recipe_id ingredients
1 cheese
1 milk
2 egg
2 chocolate
3 rice
3 corn
谢谢。
【问题讨论】: