Skip to contents

Given an object that can be coerced to POSIXlt, return the fraction of a year represented by the object.

Usage

yearlyFraction(
  t,
  year = 2022,
  input.unit = "POSIX",
  output.unit = "radians",
  timezone = NULL,
  input,
  unit
)

Arguments

t

Object to be converted to a fraction

year

The year a day number belongs to, which decides whether it is measured against 366 days. Read for input.unit="day" only: a POSIX time carries the year it falls in, and is measured against that.

input.unit

The unit the date is given in, one of "POSIX", "day".

output.unit

If set to radians outputs a position around a circle. If set to fraction outputs the raw fraction.

timezone

The timezone to read the time in, which decides which day of the year it falls on. The default, NULL, uses the timezone the time itself carries, and UTC for a time that carries none (such as the output of Sys.time()).

input

Deprecated, use input.unit instead.

unit

Deprecated, use output.unit instead.

Value

The position of the date within the year, in radians or as a fraction of a year.