Hi,
I need to calculate the number of elapsed days between two dates (visitdate and new_apptdate) for each observation excluding certain days of the week. Here is what the data look like:
+-----------------------------------------------+
| id visitdate new_app~e daysa~pt |
|-----------------------------------------------|
40. | 00542KPP-4 25nov2016 25nov2016 0 |
41. | 00542KPP-4 17feb2017 17feb2017 0 |
42. | 00542KPP-4 12may2017 12may2017 0 |
43. | 00542KPP-4 10jul2017 07jul2017 3 |
44. | 00542KPP-4 10oct2017 02oct2017 8 |
|-----------------------------------------------|
45. | 00542KPP-4 17jan2018 21nov2017 57 |
46. | 00542KPP-4 13feb2018 14feb2018 -1 |
47. | 00751KLM-1 25may2016 . . |
48. | 00751KLM-1 31may2016 31may2016 0 |
49. | 00751KLM-1 28jun2016 28jun2016 0 |
|-----------------------------------------------|
50. | 00751KLM-1 26jul2016 26jul2016 0 |
+-----------------------------------------------+
The workdays package only excludes weekends and holidays - I need to also exclude Fridays, and for a subset of observations, Thursdays as well.
Thanks for any help you can provide.
I need to calculate the number of elapsed days between two dates (visitdate and new_apptdate) for each observation excluding certain days of the week. Here is what the data look like:
+-----------------------------------------------+
| id visitdate new_app~e daysa~pt |
|-----------------------------------------------|
40. | 00542KPP-4 25nov2016 25nov2016 0 |
41. | 00542KPP-4 17feb2017 17feb2017 0 |
42. | 00542KPP-4 12may2017 12may2017 0 |
43. | 00542KPP-4 10jul2017 07jul2017 3 |
44. | 00542KPP-4 10oct2017 02oct2017 8 |
|-----------------------------------------------|
45. | 00542KPP-4 17jan2018 21nov2017 57 |
46. | 00542KPP-4 13feb2018 14feb2018 -1 |
47. | 00751KLM-1 25may2016 . . |
48. | 00751KLM-1 31may2016 31may2016 0 |
49. | 00751KLM-1 28jun2016 28jun2016 0 |
|-----------------------------------------------|
50. | 00751KLM-1 26jul2016 26jul2016 0 |
+-----------------------------------------------+
The workdays package only excludes weekends and holidays - I need to also exclude Fridays, and for a subset of observations, Thursdays as well.
Thanks for any help you can provide.
Comment