赞
踩
之前写过一篇文章是往文本文件中不断写入数据时用到了append=T,
今天用到append()
1.如何往list某列末尾添加数据?
直接用append(某list,要写入的数据)
append(x, values, after = length(x))
x |
the vector to be modified. |
values |
to be included in the modified vector. 计划贴入的对象 |
after |
a subscript, after which the values are to be appended. 表示想在x中贴的位置 |
举例:
例一:
> L1
$p1
[1] 2 3 4 5
$p2
[1] 10 11 12 13 14 15
> append(L1$p1,13)
[1] 2 3 4 5 13
例二:
> append(1:5, 0:1, after = 3)
[1] 1 2 3 0 1 4 5
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。