Helper function to convert any time period to days
convert_period_to_days(period)
A string that contains a time period, e.g. "3 days", "1 week", "2 months", "1 year"
The number of days in the time period
convert_period_to_days("3 days")
#> [1] 3
convert_period_to_days("1 week")
#> [1] 7
convert_period_to_days("2 months")
#> [1] 60
convert_period_to_days("1 year")
#> [1] 365