inst/doc/time_representation.R

## ----setup, include = FALSE---------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## -----------------------------------------------------------------------------
.leap.seconds

## -----------------------------------------------------------------------------
data(nottem)
nottem
attributes(nottem)

## -----------------------------------------------------------------------------
library(pastecs)
# A vector with a "days" time-scale (25 values every 30 days)
my_days <- (1:25) * 30
# Convert it to a "years" time-scale, using 23/05/2001 (d/m/Y) as first value
daystoyears(my_days, datemin = "23/05/2001", dateformat = "d/m/Y")

## -----------------------------------------------------------------------------
365.25/12

## -----------------------------------------------------------------------------
365.25/7

## -----------------------------------------------------------------------------
365.25/48

Try the pastecs package in your browser

Any scripts or data that you put into this service are public.

pastecs documentation built on May 29, 2024, 5:56 a.m.