I have this dataframe called Revenue
where some dates, cities and revenues are illustrated.
Date City Revenue
1989-02-25 LA 50
1989-02-25 NY 72
1989-02-25 PAR 65
1989-02-25 ROM 71
1989-02-26 NY 82
1989-02-26 BAC 73
1989-02-27 TOK 55
1989-02-27 BTH 83
1989-02-27 PAR 69
1989-02-27 NY 70
1989-02-28 NY 45
1989-03-01 HEL 95
#With 7000 more rows
What I'm trying to do is to select dates which occurs four times, in this example above 1989-02-25 and 1989-02-27 and so forth. The tibble should look something like this:
Date City Revenue
1989-02-25 LA 50
1989-02-25 NY 72
1989-02-25 PAR 65
1989-02-25 ROM 71
1989-02-27 TOK 55
1989-02-27 BTH 83
1989-02-27 PAR 69
1989-02-27 NY 70
#With 1251 more rows
Next step is to filter dates so only dates that has a revenue at or above 45 is included my tibble. The first rows will look like above but there should be a reduced amount of rows.
After that the tibble should be constrained by showing the lowest amount of a revenue per a date. So it looks like this (city is removed here) Revenue$city <- NULL
:
Date Revenue
1989-02-25 50
1989-02-27 55
#With 57 more rows
Anyone has any ideas? Quite challenging with so many steps.