9
13

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 データフレーム 列の追加

Last updated at Posted at 2015-02-09

transform関数を利用する
transform(追加する元のデータフレーム,列タイトル=c(追加データ))
(例)
>x <-data.frame(Age=c(50,50,70,60))
>x2<-transform(x,BW=c(50,45,55,55))

> x <-data.frame(Age=c(50,50,70,60))
> x
Age
1 50
2 50
3 70
4 60
> x2<-transform(x,BW=c(50,45,55,55))
> x2
Age BW
1 50 50
2 50 45
3 70 55
4 60 55

9
13
1

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
9
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?