0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

R > データ操作 / データフレーム > read.tableで読込んだリストの特定行を削除する > x[-6,] / x[-5:-7]

Last updated at Posted at 2016-10-01
動作環境
RStudio 0.99.903 on Windows 7 pro
R version 3.3.1

R機能マップ
http://qiita.com/7of9/items/0f911bcb95d3a8bbd703

read.table()で読込んだリストの特定行を削除する。

参考 http://maoringo.blogspot.jp/2010/11/r.html

実際に6行目を削除してみる。

> x
            V1            V2
1 9.999999e-09 -6.519855e-05
2 2.250000e-08 -1.055390e-05
3 6.249999e-08 -7.502142e-04
4 8.999999e-08 -2.667132e-04
5 1.225000e-07  1.113380e-04
6 2.025000e-07  1.148488e-04
7 2.500000e-07  1.298595e-05
> x[-6,]
            V1            V2
1 9.999999e-09 -6.519855e-05
2 2.250000e-08 -1.055390e-05
3 6.249999e-08 -7.502142e-04
4 8.999999e-08 -2.667132e-04
5 1.225000e-07  1.113380e-04
7 2.500000e-07  1.298595e-05

5行目から7行目の削除は以下。

> x[-5:-7,]
            V1            V2
1 9.999999e-09 -6.519855e-05
2 2.250000e-08 -1.055390e-05
3 6.249999e-08 -7.502142e-04
4 8.999999e-08 -2.667132e-04
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?