I have a dataframe of about 3 000 acquisition bids.
Variables:
- Company ID (PERMNO)
- Bid ID (ID)
- Announcement date (ANDATE)
- Bidding round (ROUND_ID)
structure(list(PERMNO = c(NA, 80094L, 61866L, 82285L, 83696L,
84048L), ID = c(101652020, 103223020, 20100020, 706474020, 713118020,
673419020), ANDATE = c("20/06/1988", "09/08/1988", "11/12/1987",
"30/10/1997", "26/11/1997", "24/06/1997"), ROUND_ID = c("50000",
"50000", "50000", "11401", "11401", "50003")), row.names = c(NA,
6L), class = "data.frame")
Bids are in competition with each other and grouped by ROUND_ID.
Problem:
I would like to write a code (probably a for loop?) that runs through each ROUND_ID and saves the first observation (by ANDATE) in a separate dataframe. I.e. I would like to subset the first bid of each bidding round.
Can anyone help me with this?