作者greenlive (綠樣)
看板Statistics
標題[問題] R的資料比對
時間Mon Dec 3 17:12:57 2007
在程式中,有兩筆dataA與dataB
如果希望將兩筆data比對符合的data另行收錄到另外一個matrix中
該如何下指令呢?
ex:
for(i in 1:1000)
{
if(match(A[i,],B[1,])>0)
{指令?
}
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.121.97
※ 編輯: greenlive 來自: 140.112.121.97 (12/03 17:13)
推 bugle:你要怎麼收錄? 長度不一是沒有辦法放到一個matrix的(NA?) 12/03 18:52
推 h0h1:library(sqldf); identical(x,y) 12/03 20:36
推 bugle:原PO用了match,所以應該不是identical 12/03 21:01