Here is fake data to aid discussion on tidying data. It is a dataframe with the following columns: ID, steroid, dosage, start.date, end.date.
Questionnaire form: https://forms.office.com/e/nhzqxQp1Mz
Some observations:
Rscript -e 'lintr::lint("orig_Data_clean.R")' > orig_lint
Rscript -e 'lintr::lint("Data_clean.R")' > new_lint
-
Don't be parsing dates with regexes, lubridate is your friend.