将未知数的行拼合成一个不知道的姓

时间:2018-10-15 11:51:13

标签: r dplyr

我有一个包含动态行和列的结果数据框(我们每次运行脚本时都不知道会有多少行)

为了论证,假设我们得到了这个df:

reference amount_france amount_germany amount_uk
A            10             NA             NA
B            NA             32             NA
B            NA             NA             34
C            9              NA             NA

预期输出:

reference amount_france amount_germany amount_uk
A            10             NA             NA
B            NA             32             34
C            9              NA             NA

请注意,我不能使用我们不知道的名字(它们是动态生成的)

0 个答案:

没有答案