Within the 'determine which is home' for loop, 'xx' is the midpoint of two datetime objects. When the midpoint is calculated to be midnight, only the date is returned. This can be replicated with:
mydates <- as.POSIXct("2018-01-01 00:00:00", tz = "UTC")
mydates
[1] "2018-01-01 UTC"
This results in 'hourofday' being NA as an hour cannot be found. By adding the suggested format wrapper, the time is maintained and 'hourofday' can be determined. It can then successfully be applied to the embedded if-statement within the loop.
mydates <- format(as.POSIXct("2018-01-01 00:00:00", tz = "UTC"), "%Y-%m-%d %H:%M:%S")
mydates
[1] "01-01-2018 00:00:00"
* Added OPTICS - lightweight clustering algorithm.
* Changed the error message for inconsistent parameters in CONFIG
* Removing hardcoded values and changing default EPS value in the clustering algorithm.
* Added Observation in Doryab Feature docs.
Co-authored-by: nikunjgoel95 <nikunjgoel2009@gmail.com>
* Fixing the doryab location features for context of clustering.
* Fixed the wrong shifting while calculating the distance.
* Refractoring the haversine function
* Removed comments.
* Cleaning parts of the code.
* Updated the documentation for CLUSTER_ON parameter.
Co-authored-by: nikunjgoel95 <nikunjgoel2009@gmail.com>