sh_year: Get/set the year component of Jalali date-time objects

View source: R/getters.R

sh_yearR Documentation

Get/set the year component of Jalali date-time objects

Description

Get/set the year component of Jalali date-time objects

Usage

sh_year(x)

## S3 method for class 'jdate'
sh_year(x)

## S3 method for class 'jdatetime'
sh_year(x)

sh_year(x) <- value

## S3 replacement method for class 'jdate'
sh_year(x) <- value

## S3 replacement method for class 'jdatetime'
sh_year(x) <- value

Arguments

x

A vector of jdate or jdatetime objects.

value

A numeric vector.

Details

For assignment, x and value are recycled to their common size using tidyverse recycling rules.

Value

The year component of x as an integer.

Examples

x <- jdate("1402-12-14")
sh_year(x)
sh_year(x) <- 1400:1401

shide documentation built on Sept. 11, 2024, 6:37 p.m.