I have a tibble of Study events grouped by ID (with dates for each event), and I'm looking to add a value for each identical event by ID.
mydata <- tibble(ID = list("AA", "AA", "AA", "GA", "GA", "GA","GA","GA","GA","GA",GA"),
EventDate = list("21-10-2010","23-10-2010", "01-11-2010","16-01-2015","17-01-2015","02-02-2015","09-02-2015","03-03-2015","16-03-2015","20-03-2015","03-04-2015")
Event = list("Intro","Scan","Report", "Intro","Scan","Report","Scan","Report","Other","Scan","Report)
So what I'd like to do is add a column with an event number for each scan by ID (so the Scan event would be marked as 1 for AA, and 1-3 respectively for GA)
I'd also like to then do the same for the report, while not losing any other of the events in the table
(apologies for the rubbish reprex, but cannot install the necessary packages for a decent one!)