custom_cycle: Create a custom cycle and compare with data

Description Usage Arguments Value Author(s) Examples

View source: R/custom_cycle.R

Description

The function creates a cycle according to user-specified input. It is possible to define one or two parts (e.g. 12.4 hours followed by 5 hours and so on).Furthermore the function produces information of the iteration count and the part of the cycle (called A and B) according to the input data.

Usage

1
custom_cycle(data_POSIXct, starting_point = NULL, hours_part_A, hours_part_B = 0)

Arguments

data_POSIXct

An object of class POSIXct.

starting_point

Optional object of class POSIXct. The default is to start the first cycle at the same time of the earliest data_POSIXct object. A custom starting_point should be prior to the earliest data_POSIXct object.

hours_part_A

Required. A positive number indicating the hours of the first part of the cycle.

hours_part_B

Optional. A positive number indicating the hours of the second part of the cycle. Default is 0.

Value

The output is a data.frame object including information about the starting points, iteration count and part of the cycle according to each sample (data_POSIXct).

Author(s)

Frederik Sachser

Examples

1
2
3
now <- as.POSIXct(x = "2015-01-30 20:58:00", tz = "CET", origin = "01/01/1970")
art_date <- seq(now, now + 90*60*99, 90*60)
custom_cycle(data_POSIXct = art_date, starting_point = now, hours_part_A = 12.5, hours_part_B = 5)

sachserf/chronobiology documentation built on May 29, 2019, 12:21 p.m.