Skip to content
Prev 387616 / 398502 Next

How to average minutes per hour per month in the form of '# hours #minutes'

Avi, I see no limitations in using R for this task, so throwing Python into the discussion seems only to confuse the issue. I just see multiple ways to interpret the desired calculation of the result, as illustrated by your discussion and elaborated in my next paragraph, and I would rather the OP did the work of clarifying what his needs are so the question becomes about R instead of about different people guessing what the goal is.

For example, you could calculate an average daily hours billed and multiply by seven, or you could prorate hours in partial weeks and calculate the average of those weekly values, or you could simply exclude partial weeks, and then there is the issue of whether a week begins on Monday or Sunday. There is the discrepancy of asking for "by week by month" and then saying he really wants three specific months at a time... does he plan to calculate weekly summaries within months and then average three months? This is not a reasonable question for this mailing list yet.

I acknowledge that OP may not have these answers now but answers (intentional or not) will have to be embedded in whatever solution is proposed, even if some random method in a Python package purports to solve this in one line of code. So either answers from the insurance company or arbitrarily selected by OP should be identified.
On March 26, 2021 2:28:21 PM PDT, Avi Gross via R-help <r-help at r-project.org> wrote: