【发布时间】:2015-11-14 11:29:01
【问题描述】:
我有一个数据框,我试图将数据框拆分为单独的数据集,并将数据集的文件名作为数据框的 colnames
df1 <-
` Name test1 test2 test3`
ad1 43 44 42
ad2 32 32 23
ad3 21 26 23
期望的输出:3 个单独的文件 test1.txt , test2.txt, test3.txt
test1.txt = Name test1
ad1 43
ad2 32
ad3 21
test2.txt = Name test2
ad1 44
ad2 32
ad3 26
test3.txt = Name test3
ad1 42
ad2 23
ad3 23
【问题讨论】:
-
您的意思是要将它们写入新文件?
-
你需要这个是动态的吗?还是仅针对这种特定情况?
-
@AnandaMahto,是的,我想把它们写成新文件。