subtracting one data frame from the other

Suppose I have a larger data frame and a smaller one. If the smaller one is contained inside the larger one, how can I have:

Larger - Smaller

Example:

Small data frame:

     ID       CSF1PO CSF1PO.1 D10S1248 D10S1248.1 D12S391 D12S391.1
203079_BA_M     10       11       14         16      -9        -9
203079_BA_F      8       12       14         17      -9        -9
203080_BA_M     10       12       13         13      -9        -9

Big data frame:

      ID      CSF1PO CSF1PO.1 D10S1248 D10S1248.1 D12S391 D12S391.1
203078_MG_M     -9       -9       15         15      18        20
203078_MG_F     -9       -9       14         15      17        19
203079_BA_M     10       11       14         16      -9        -9
203079_BA_F      8       12       14         17      -9        -9
203080_BA_M     10       12       13         13      -9        -9
203080_BA_F     10       11       14         16      -9        -9
203081_MG_M     10       12       14         16      -9        -9
203081_MG_F     11       12       15         16      -9        -9
203082_MG_M     11       11       13         15      -9        -9
203082_MG_F     11       11       13         14      -9        -9

The small data frame corresponds to the rows 3, 4 and 5 of the larger data frame.

Thanks!

Answers


Try this:

BigDF[ !(BigDF$ID %in% SmallDF$ID), ]

Need Your Help

Search engine parser flow diagram

search-engine

Do you guys know where i can find a search engine parser design diagram?

Modification of a Dictionary in PYTHON

python python-2.7 dictionary

I am beginner with python. I have this following dictionary and I want to modify it to get the dictionary I require. It looks wired but you can observe keys are almost similar.