0

data.tables について 2 つ目の質問があります。私の知る限り、マージはデータ テーブルの結合と呼ばれます。マージの種類 (1 対 1、多対 1、1 対多)、および「使用中」のデータセットの変数がマスター データセットの変数を置き換えるかどうかを制御するにはどうすればよいですか?

また、マージを実行するためにキーが必要で、データに対して複数のマージを実行する必要がある場合、キーを変更し続ける必要がありますか? これは私にはあまりきれいではないようです....

前もってありがとう、マッテオ

4

1 に答える 1

0

関数で遊んでみることができmerge()ます。そこで、data.frames をマージする方法を定義できます。

x, y    
data frames, or objects to be coerced to one.

by, by.x, by.y  
specifications of the columns used for merging. See ‘Details’.

all 
logical; all = L is shorthand for all.x = L and all.y = L, where L is either TRUE or FALSE.

all.x   
logical; if TRUE, then extra rows will be added to the output, one for each row in x that has no matching row in y. These rows will have NAs in those columns that are usually filled with values from y. The default is FALSE, so that only rows with data from both x and y are included in the output.

all.y   
logical; analogous to all.x.

詳細については、お試しください?merge

こちらのQuickR Mergeもご覧ください。

于 2013-03-18T12:49:34.160 に答える