plees-tracker icon indicating copy to clipboard operation
plees-tracker copied to clipboard

[FeatureRequest] Add option for median instead of mean

Open le-jun opened this issue 2 years ago • 3 comments

Would it be possible to add an option for median instead of mean? I'd rather know that I tend to sleep this much daily (or for each sleep including naps) than for it to be under influence of, say, sick days where I undersleep or oversleep. In a way, this is complementary to #388.

le-jun avatar Dec 29 '23 05:12 le-jun

Sure, it would be reasonably straightforward to add this. Are you interested in trying to do this yourself?

vmiklos avatar Dec 29 '23 07:12 vmiklos

Ha, I can't code for my life so I'll pass on this. But I'll take notes about your way of doing it!

le-jun avatar Dec 29 '23 16:12 le-jun

app/src/main/java/hu/vmiklos/plees_tracker/DataModel.kt:411 is where we currently produce a list of daily sums, and then count the average of this list. I believe that's where we can conditionally do a median instead.

vmiklos avatar Dec 30 '23 20:12 vmiklos