spiral_initialize_by_time: Initialize the spiral from time objects

Description Usage Arguments Details Value Examples

View source: R/initialize.R

Description

Initialize the spiral from time objects

Usage

1
2
3
4
5
spiral_initialize_by_time(xlim, start = NULL, end = NULL,
    unit_on_axis = c("days", "months", "weeks", "hours", "mins", "secs"),
    period = c("years", "months", "weeks", "days", "hours", "mins"),
    normalize_year = FALSE, period_per_loop = 1, polar_lines_by = NULL,
    verbose = TRUE, ...)

Arguments

xlim

Range of the time. The value can be time object such as Date, POSIXlt or POSIXct. The value can also be characters and it is converted to time objects automatically.

start

Start of the spiral, in degrees. By default it is automatically calculated.

end

End of the spiral, in degrees. By default it is automatically calculated.

unit_on_axis

Units on the axis.

period

Which period to use?

normalize_year

Whether to enforce one loop to represent a complete year?

period_per_loop

How many periods to put in a loop?

polar_lines_by

By default different value of polar_lines_by is set for different period. E.g. 360/7 is set if period is "weeks" or 360/24 is set if peroid is set to "hours". When period is year and unit_on_axis is day, the proportion of sectors by polar lines corresponds to the proportion of month days in a year.

verbose

Whether to print messages?

...

All pass to spiral_initialize.

Details

"start" and "end" are automatically calculated for different "unit_on_axis" and "period". For example, if "unit_on_axis" is "days" and "period" is "years", then the first day of each each year is always put on theta = 0 + 2*pi*k where k is the index of loops.

Value

No value is returned.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
spiral_initialize_by_time(xlim = c("2014-01-01", "2021-06-17"))
spiral_track(height = 0.6)
spiral_axis()

spiral_initialize_by_time(xlim = c("2021-01-01 00:00:00", "2021-01-05 00:00:00"))
spiral_track(height = 0.6)
spiral_axis()

spiral_initialize_by_time(xlim = c("2021-01-01 00:00:00", "2021-01-01 00:10:00"),
    unit_on_axis = "secs", period = "mins")
spiral_track(height = 0.6)
spiral_axis()

spiralize documentation built on Feb. 6, 2022, 1:06 a.m.