Apply Parallelogram Truncation and Convert Back to Datetime
Source:R/parallelogram_truncation.R
parallelogram_fit.RdThis function fits a parallelogram to the ascending segment of melatonin profile data, calculates its corners, and determines whether it meets predefined constraints. If the parallelogram does not satisfy the slope ratio criteria, a warning is issued.
Value
A list containing:
pll_datetime_0: The leftmost x-coordinate (datetime) of the parallelogram.pll_datetime_1: The rightmost x-coordinate (datetime) of the parallelogram.pll_slope: The optimized slope of the parallelogram.corners: The four corner points of the parallelogram.flag: Logical indicating whether the parallelogram violates constraints.