2
file1
   ID Length Breadth height qty1
1 201   2500    1250   7.85 200
2 201      0      10   5.85 245
3 202      0       0   7.85 245

file2
   ID Length Breadth height qty2
1 201    250      12   7.85 200
2 201      0      10   5.85 250
3 202      0      12   8.00 200

I want all the rows where ID ,length , breadth & height matches

match1= stock[(req$ID == stock$ID) & (req$Length==stock$Length) &
               (req$Breadth==stock$Breadth) & (req$height==stock$height),]
match1

ID Length Breadth height    qty1    qty2
201  0        10    5.85    245     250
Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
Raja
  • 221
  • 1
  • 2
  • 4
  • 2
    You want `merge`. Something like `merge(file1, file2, by=c("ID", "Length", ...))` where `...` are the names of the remaining variables to merge on. – lmo Jul 13 '17 at 03:46
  • `merge(file1, file2)` or `merge(file1, file2, by = c("ID", "Length", "Breadth", "height"))` to be specific. – Ronak Shah Jul 13 '17 at 04:29

0 Answers0