0

Ok, so I have my dataset for firms that seems like this

There are 98688 firms that are shown 6 years

So this data base is

Balances

Year     FirmID      Sales
2014       A101        3 
2015       A101        5
2016       A101        2
2017       A101        1
2018       A101        3

2014       B107        3 
2015       B107        5
2016       B107        2
2017       B107        1
2018       B107        3
 .          .          .
 .          .          .
 .          .          .
 .          .          .

And I have a list that I need to get rid off that list is just like this

Sacar

FirmID    Sacar
A101      sacar
B107      sacar
.         sacar
.         sacar
.         sacar

How would you do it?

I was trying with a left join and then a filter

Jorge Paredes
  • 996
  • 7
  • 13

1 Answers1

1
Balances %>% 
  dplyr::filter(!FirmID %in% Sacar$FirmID)

This should remove all FirmID in Sacar which are there in Balances.

jsv
  • 740
  • 3
  • 5