spiral_initialize_by_time: Initialize the spiral from time objects

View source: R/initialize.R

spiral_initialize_by_timeR Documentation

Initialize the spiral from time objects

Description

Initialize the spiral from time objects

Usage

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 base::Date, base::POSIXlt or base::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 spiral loop to represent a complete year?

period_per_loop

How many periods to put in a spiral 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 spiral loops.

Value

No value is returned.

Examples

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()

jokergoo/spiralize documentation built on June 16, 2024, 4:35 a.m.