對於不合適的Title!爲列中的多個值中的每一個值創建單獨的data.frame行
一些貨幣都使用一個以上的國家
我有它結合了國家一列的表
df<- data.frame(code=c("DKK","DZD","EGP"), country=c("Denmark, Faroe Islands, Greenland",
"Algeria","Egypt,Palestinian territories"))
code country
1 DKK Denmark, Faroe Islands, Greenland
2 DZD Algeria
3 EGP Egypt,Palestinian territories
我想,這樣我結束了
到單獨的這種組合場code country
1 DKK Denmark
2 DKK Faroe Islands
3 DKK Greenland
4 DZD Algeria
5 EGP Egypt
6 EGP Palestinian territories
TIA
請參閱[這非常類似的問題](http://stackoverflow.com/questions/21124838/split-thousands-of-columns-at-a-time-by-on-multiple-lines-sort-the-values -一世)。 – BrodieG
像'strsplit'這樣的東西在這裏可以很好地工作。 –