File: year-month-weekday-boundary.Rd

package info (click to toggle)
r-cran-clock 0.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,856 kB
  • sloc: cpp: 19,564; sh: 17; makefile: 2
file content (50 lines) | stat: -rw-r--r-- 1,604 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gregorian-year-month-weekday.R
\name{year-month-weekday-boundary}
\alias{year-month-weekday-boundary}
\alias{calendar_start.clock_year_month_weekday}
\alias{calendar_end.clock_year_month_weekday}
\title{Boundaries: year-month-weekday}
\usage{
\method{calendar_start}{clock_year_month_weekday}(x, precision)

\method{calendar_end}{clock_year_month_weekday}(x, precision)
}
\arguments{
\item{x}{\verb{[clock_year_month_weekday]}

A year-month-weekday vector.}

\item{precision}{\verb{[character(1)]}

One of:
\itemize{
\item \code{"year"}
\item \code{"month"}
}}
}
\value{
\code{x} at the same precision, but with some components altered to be
at the boundary value.
}
\description{
This is a year-month-weekday method for the \code{\link[=calendar_start]{calendar_start()}} and
\code{\link[=calendar_end]{calendar_end()}} generics. They adjust components of a calendar to the
start or end of a specified \code{precision}.

This method is restricted to only \code{"year"} and \code{"month"} \code{precision}s, and
\code{x} can't be more precise than month precision. Computing the "start" of
a day precision year-month-weekday object isn't defined because
a year-month-weekday with \verb{day = 1, index = 1} doesn't necessarily occur
earlier (chronologically) than \verb{day = 2, index = 1}. Because of these
restrictions, this method isn't particularly useful, but is included for
completeness.
}
\examples{
# Month precision
x <- year_month_weekday(2019, 1:5)
x

# Compute the last month of the year
calendar_end(x, "year")
}